2017-09-12 41 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