简体   繁体   English

mix deps.get失败(似乎缺少ssl?)

[英]mix deps.get failed (seems missing ssl?)

I'm sorry but I'm new to Elixir. 对不起,我是Elixir的新手。 while building phoenix application, mix deps.get failed with an error. 在构建phoenix应用程序时, mix deps.get失败并显示错误。

% mix deps.get
Could not find Hex, which is needed to build dependency :phoenix
Shall I install Hex? [Yn] y
** (MatchError) no match of right hand side value: {:error, {:ssl, {'no such file or directory', 'ssl.app'}}}
    (mix) lib/mix/utils.ex:409: Mix.Utils.read_httpc/1
    (mix) lib/mix/utils.ex:354: Mix.Utils.read_path/2
    (mix) lib/mix/local.ex:107: Mix.Local.read_path!/2
    (mix) lib/mix/local.ex:86: Mix.Local.find_matching_versions_from_signed_csv!/2
    (mix) lib/mix/tasks/local.hex.ex:23: Mix.Tasks.Local.Hex.run/1
    (mix) lib/mix/dep/loader.ex:140: Mix.Dep.Loader.with_scm_and_app/4
    (mix) lib/mix/dep/loader.ex:98: Mix.Dep.Loader.to_dep/3
    (elixir) lib/enum.ex:1043: anonymous fn/3 in Enum.map/2
%

erlang and elixir has been installed via kerl and asdf . erlang和elixir已通过kerlasdf安装。 and my installation log is here http://otiai10.hatenablog.com/entry/2016/02/03/154953 我的安装日志在这里http://otiai10.hatenablog.com/entry/2016/02/03/154953

envirionment envirionment

  • MacOS: 10.11.2 MacOS:10.11.2
  • Erlang: 18.0 Erlang:18.0
  • Elixir: 1.1.1 Elixir:1.1.1

What is happening and what should I do? 发生了什么,我该怎么办?

In case you arent using kerl and you already did brew install openssl , they added ERLANG_OPENSSL_PATH option to asdf so you can do 如果你不使用kerl并且你已经做了brew install openssl ,他们为asdf添加了ERLANG_OPENSSL_PATH选项,这样你就可以做到

asdf plugin-update erlang
ERLANG_OPENSSL_PATH="/usr/local/opt/openssl" asdf install erlang 21.1

As @biletskyy answered, it was missing of SSL on Erlang installed via kerl, unlike via brew. 正如@biletskyy回答的那样,在通过kerl安装的Erlang上缺少SSL,与brew不同。

If you want to build Erlang with ssl via kerl, you should pass KERL_CONFIGURE_OPTIONS like below 如果你想通过KERL_CONFIGURE_OPTIONS用ssl构建Erlang,你应该传递KERL_CONFIGURE_OPTIONS如下所示

KERL_CONFIGURE_OPTIONS="--with-ssl=/usr/local/opt/openssl" kerl build 18.0 18.0-foo

Then install Elixir via asdf. 然后通过asdf安装Elixir。 The mix command would work well. mix命令运行良好。

Thanks to @biletskyy 感谢@biletskyy

I wasn't using asdf and had this same problem. 我没有使用asdf并遇到同样的问题。 I typically used brew, but for erlang, I was using evm so I could have multiple versions. 我通常使用brew,但对于erlang,我使用evm,所以我可以有多个版本。

This seemed to help me: https://github.com/robisonsantos/evm/issues/28 这似乎对我有所帮助: https//github.com/robisonsantos/evm/issues/28

I was using EVM and needed to point it to openssl in order to get mix deps.get to work. 我正在使用EVM并需要将其指向openssl才能使mix deps.get工作。 In my case, I was on OTP 21.2, so I did this: 在我的情况下,我在OTP 21.2,所以我这样做:

evm uninstall OTP_21.2
evm install OTP_21.2 --with-ssl=/usr/local/opt/openssl

All was right with the world after that. 在那之后,一切都是对的。 I could run mix deps.get once I did this. 一旦我这样做,我就可以运行mix deps.get

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM