【问题标题】:Elixir .exs script "module is not loaded and could not be found" when using Mix使用 Mix 时 Elixir .exs 脚本“模块未加载且无法找到”
【发布时间】:2013-11-07 18:32:24
【问题描述】:

我的根目录中有一个 .exs 脚本,我希望它能够在命令行上执行,例如 elixir my_script.exs。在我在项目中初始化 Mix 之前,我的脚本正在运行,但现在它不起作用。我可以看到 Mix 正在将 .beam 文件放在 ebin/ 目录中,但显然我的脚本没有在其中查找。

将自定义模块加载到 .exs 脚本中的正确方法是什么?

【问题讨论】:

    标签: shell module erlang elixir-mix elixir


    【解决方案1】:

    你可以像这样运行脚本:mix run my_script.exs

    mix compile
    elixir -pa ebin/ my_script.exs 
    

    【讨论】:

      猜你喜欢
      • 2019-01-18
      • 2018-11-26
      • 1970-01-01
      • 2020-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-25
      • 1970-01-01
      相关资源
      最近更新 更多