Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mix deps.get failed (seems missing ssl?)

I'm sorry but I'm new to Elixir. while building phoenix application, mix deps.get failed with an error.

% 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. and my installation log is here http://otiai10.hatenablog.com/entry/2016/02/03/154953

envirionment

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

What is happening and what should I do?

like image 392
otiai10 Avatar asked Feb 03 '16 07:02

otiai10


2 Answers

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

asdf plugin-update erlang
ERLANG_OPENSSL_PATH="/usr/local/opt/openssl" asdf install erlang 21.1
like image 104
Jozef Vaclavik Avatar answered Sep 21 '22 11:09

Jozef Vaclavik


As @biletskyy answered, it was missing of SSL on Erlang installed via kerl, unlike via brew.

If you want to build Erlang with ssl via kerl, you should pass KERL_CONFIGURE_OPTIONS like below

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

Then install Elixir via asdf. The mix command would work well.

Thanks to @biletskyy

like image 23
otiai10 Avatar answered Sep 25 '22 11:09

otiai10