【问题标题】:Could not compile dependency :mimerl when adding wallaby to my Elixir/Phoenix project将小袋鼠添加到我的 Elixir/Phoenix 项目时无法编译依赖项:mimerl
【发布时间】:2018-04-17 21:19:50
【问题描述】:

我是 Elixir/Phoenix 的新手,我现在希望使用 Wallaby(或 Hound,但这是同一个问题)编写测试。

供您参考,我使用的是 Docker 映像。

我正在尝试让 CabbageWallaby 正常工作,但是一旦我将 Wallaby 依赖项添加到我的项目中:

...
  defp deps do
    {:phoenix, "~> 1.3.0"},
    ...
    {:cowboy, "~> 1.0"},
    {:wallaby, "~> 0.19.2"}
  end
...

然后我运行mix test时出现以下错误:

escript: exception error: no match of right hand side value undefined
  in function  rebar_log:log/3 (/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_log.erl, line 94)
  in call from rebar3:handle_error/1 (/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl, line 325)
  in call from escript:run/2 (escript.erl, line 759)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3
** (Mix) Could not compile dependency :mimerl, "/root/.mix/rebar3 bare compile --paths "/application/_build/test/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile mimerl", update it with "mix deps.update mimerl" or clean it with "mix deps.clean mimerl"

谁知道我为什么会出现这个错误以及如何解决它?

【问题讨论】:

    标签: docker elixir wallaby


    【解决方案1】:

    我终于弄清楚是什么导致了这个问题:代理!

    我首先尝试手动运行这个 rebar3 进程:

    docker run --rm -it <container-name> /root/.mix/rebar3
    

    我已经遇到了错误。 在容器中玩耍,我发现删除代理会使该过程不再出现任何错误。

    所以,不管 Docker 是什么,都是为了取消设置我机器的公司代理,以便让它通过公共网络工作。

    【讨论】:

      【解决方案2】:

      您可以在依赖版本之后添加 ,仅: :test 并尝试这样做,并在运行 mix test 之前运行 mix deps.get em>

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-10-20
        • 1970-01-01
        • 2016-03-31
        • 2019-02-10
        • 1970-01-01
        • 2023-03-12
        • 1970-01-01
        • 2021-01-14
        相关资源
        最近更新 更多