我想通過amqp從elixir phoenix應用程序中使用rabbitMQ。我也跟着教程official website但仍然在mix.deps compile
,我得到一個錯誤:如何設置Elixir項目通過amqp使用RabbitMQ?
include/amqp_gen_consumer_spec.hrl:30: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:31: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:32: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:34: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:35: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:36: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:37: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:38: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:39: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:42: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:30: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:31: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:32: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:34: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:35: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:36: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:37: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:38: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:39: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:42: syntax error before: '/'
Compiling src/amqp_selective_consumer.erl failed:
ERROR: compile failed while processing /home/bmarkons/soc2016-marko/telegram/deps/amqp_client: rebar_abort
** (Mix) Could not compile dependency :amqp_client, "/usr/bin/rebar compile skip_deps=true deps_dir="/home/bmarkons/soc2016-marko/telegram/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile amqp_client", update it with "mix deps.update amqp_client" or clean it with "mix deps.clean amqp_client"
我只加:AMQP和{:AMQP, 「〜> 0.1.4」},在mix.exs文件:
def application do
[mod: {App, []},
applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex, :amqp]]
end
defp deps do
[{:phoenix, "~> 1.2.0"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.6"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"},
{:amqp, "~> 0.1.4"}]
end
我需要做些什麼改變,讓我的elixir應用程序與rabbitMQ一起工作?
謝謝
嗯,這很奇怪。你有沒有試圖清理你的依賴關係? 'mix deps.clean --all'然後'mix deps.get'和'mix deps.compile'。另外,您使用的是哪種版本的Elixir? –
我正在使用Elixir 1.3.1。我也嘗試過,但仍然出現錯誤。 –
什麼是Erlang版本? –