【问题标题】:Cannot compile simple Elixir Project无法编译简单的 Elixir 项目
【发布时间】:2015-12-23 17:43:02
【问题描述】:

我正在阅读 Dave Thomas 的“Programming Elixir”。我现在正要创建你的第一个混音项目。 HTTPoison 刚刚被引入并添加到 mix.exs 中的应用程序功能中。现在应该第一次使用iex -S mix 编译项目。那时我遇到了ssl_verify_hostname 的问题。安装 erlang-srcerlang-dev 后,我现在被以下控制台输出困住了

$ iex -S mix
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

WARN:  Expected /home/..../issues/deps/idna to be an app dir (containing ebin/*.app), but no .app found.
WARN:  Expected /home/..../issues/deps/ssl_verify_hostname to be an app dir (containing ebin/*.app), but no .app found.
==> hackney (compile)
WARN:  Expected /home/..../issues/deps/idna to be an app dir (containing ebin/*.app), but no .app found.
WARN:  Expected /home/..../issues/deps/ssl_verify_hostname to be an app dir (containing ebin/*.app), but no .app found.
Dependency not available: idna-.* ({git,
                                       "https://github.com/benoitc/erlang-idna",
                                       {tag,"1.0.2"}})
Dependency not available: ssl_verify_hostname-.* ({git,
                                                   "https://github.com/deadtrickster/ssl_verify_hostname.erl",
                                                   {tag,"1.0.5"}})
** (ArgumentError) argument error
    (stdlib) :io.put_chars(#PID<0.26.0>, :unicode, <<69, 82, 82, 79, 82, 58, 32, 99, 111, 109, 112, 105, 108, 101, 32, 102, 97, 105, 108, 101, 100, 32, 119, 104, 105, 108, 101, 32, 112, 114, 111, 99, 101, 115, 115, 105, 110, 103, 32, 47, 104, 111, 109, 101, 47, 114, 107, 114, 97, 117, ...>>)
    (mix) lib/mix/shell.ex:78: Mix.Shell.do_cmd/2
    (mix) lib/mix/tasks/deps.compile.ex:161: anonymous fn/5 in Mix.Tasks.Deps.Compile.do_command/4
    (mix) lib/mix/project.ex:196: Mix.Project.in_project/4
    (elixir) lib/file.ex:1061: File.cd!/2
    (mix) lib/mix/dep.ex:137: Mix.Dep.in_dependency/3
    (mix) lib/mix/tasks/deps.compile.ex:160: Mix.Tasks.Deps.Compile.do_command/4
    (mix) lib/mix/tasks/deps.compile.ex:59: anonymous fn/3 in Mix.Tasks.Deps.Compile.compile/1

虽然我搜索了此输出的不同部分,但我找不到任何有用的信息。

【问题讨论】:

  • 您使用的是哪个 Elixir 版本?你能把项目上传到 Github 让我们看看吗?发生了一些非常奇怪的事情。
  • 其实。恐怕您遇到rebar 问题(rebar 是 Erlang 构建工具)。确保卸载所有可用的 rebar(请与 which rebar 核对),然后重试。
  • @JoséValim:Elixir 版本是 1.0.5。我已经推送了这个项目hererebar 未安装。会不会是这个问题?
  • 将 erlang 分解成许多小部分的 linux 发行版确实很难同时使用 erlang 和 elixir。我强烈建议直接从 erlang.org 安装 erlang。
  • 我只是想确认一切在本地运行良好,因此很可能确实与您的 Erlang 安装有关。正如 Fred 所说,我会尝试从 erlang.org 或 Erlang Solutions 安装 Erlang。我们的文档中的更多信息:elixir-lang.org/install.html#installing-erlang

标签: elixir elixir-mix


【解决方案1】:

您必须在运行代码之前安装所有依赖项。

mix deps.get(它会下载依赖项)

mix deps(它安装依赖项)

【讨论】:

  • 不幸的是,这对我不起作用。事实上,正如 Jose Valim 所建议的那样,这似乎真的是一个rebar 问题。但直到现在我都想不出如何摆脱它。与此同时,我正在运行一个可以使用 mix 的 VirtualBox 映像。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-30
  • 2010-12-01
  • 2016-12-18
  • 2013-10-21
相关资源
最近更新 更多