【问题标题】:https://github.com/oarrabi/phoenix_facebook_echo_bot doesn't work on Elixir 1.3.3 with Phoenix 1.2.1https://github.com/oarrabi/phoenix_facebook_echo_bot 不适用于带有 Phoenix 1.2.1 的 Elixir 1.3.3
【发布时间】:2016-12-27 00:03:57
【问题描述】:

当我在 elixir 1.3.3 和 phoenix 1.2.1 下运行 mix phoenix.server 时,我得到了这个错误:

paul@learning:~/elixir/phoenix_facebook_echo_bot$ mix phoenix.server
==> httpotion
Compiling 1 file (.ex)

== Compilation error on file lib/httpotion.ex ==
** (ArgumentError) Access is not a protocol
    (elixir) lib/protocol.ex:76: Protocol.assert_protocol!/2
    lib/httpotion.ex:292: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

could not compile dependency :httpotion, "mix compile" failed. You can recompile this dependency with "mix deps.compile httpotion", update it with "mix deps.update httpotion" or clean it with "mix deps.clean httpotion"

我尝试遵循以下建议:myfreeweb/httpotion#87

然后当我混合 deps.update --all 时,我得到以下错误:

paul@learning:~/elixir/phoenix_facebook_echo_bot$ mix deps.update --all
Running dependency resolution

Failed to use "httpotion" (versions 3.0.0 to 3.0.2) because
  facebook_messenger (versions 0.2.0 and 0.3.0) requires ~> 2.2
  mix.exs specifies ~> 3.0.0

Failed to use "poison" (version 2.2.0) because
  phoenix (version 1.2.1) requires ~> 1.5 or ~> 2.0
  phoenix_facebook_messenger (versions 0.1.0 and 0.3.0) requires ~> 2.1.0

** (Mix) Hex dependency resolution failed, relax the version requirements of your dependencies or unlock them (by using mix deps.update or mix deps.unlock). If you are unable to resolve the conflicts you can try overriding with {:dependency, "~> 1.0", override: true}

请告知我应该如何解决这个“循环依赖错误”?

【问题讨论】:

  • 试试rm -rf _build && mix compile

标签: facebook elixir phoenix-framework


【解决方案1】:

AccessElixir 1.0.5 之前是 protocol。以Elixir 1.1.0 开头,Access 改为behaviour

phoenix_facebook_echo_bot 需要 HTTPotion 版本 2。后者又构建在 Elixir 1.0 之上,期望 Access 成为 protocol

运行代码的唯一简单选择是安装 Elixir v1.0.5 并使用它来玩这个包。

其他选项是克隆包以及它所关联的 facebook_messenger 包,并将它们的 mix.exs 文件更改为需要 HTTPotion 版本 3` 并尝试运行(我不保证成功。)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 2019-08-27
    • 2018-05-22
    相关资源
    最近更新 更多