2017-09-12 38 views
0

我试图从ExActor Demos运行计算器演示。它需要在mix.exs文件中添加新的ExActor模块作为依赖项,如下所示。Elixir:无法编译ExActor依赖项

defp deps do 
[ 
    {:exactor, "~> 2.2.3", warn_missing: false} 
] 
end 

我做mix deps.getmix deps.update --all下载的依赖。但是,当我使用mix run -e CalculatorDemo.exs运行项目时,它会引发以下错误。

[email protected]:~/calculator$ mix run -e CalculatorDemo.run 
Compiling 2 files (.ex) 

== Compilation error in file lib/calculator.ex == 
** (CompileError) lib/calculator.ex:2: module ExActor is not loaded and could not be found 
(elixir) expanding macro: Kernel.use/1 
lib/calculator.ex:2: Calculator (module) 

我是Elixir的新手,无法找到任何有用的来源来解决上述问题。任何评论我在这里做错了什么?

回答

2

exactor包中没有ExActor模块。 Since version 0.3.0,您需要use ExActor.GenServer来创建一个GenServer模块。你链接到的例子是4年前最后更新的,很可能在v0.3.0之前。

所以,变化:

use ExActor 

到:

use ExActor.GenServer 

同样计算器例如is also present in the project's README与最新的赃官工程;您可能想要运行该代码。

+0

谢谢,@Dogbert。 – COSTA