Can't install Hex

Hello world

I am having a problem over here and would appreciate any help or pointers. I am using asdf version manager to use elixir v1.4.4 with erlang-OTP v19.3 for a project. It could be a problem related to asdf, however I wouldn’t know. I would appreciate your help to determine the root of this problem. I am running Linux, ParrotOS (Debian based) 4.7 to be specific. I have had the newest version of elixir/erlang running on this machine for a month ago. I am trying to get used to version managers and use the project specified setup.

This is what I got.

erl -v
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V8.3

elixir --version
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.4.4


mix local.hex
** (MatchError) no match of right hand side value: {:error, {:ssl, {‘no such file or directory’, ‘’}}}
(mix) lib/mix/utils.ex:432: Mix.Utils.read_httpc/1
(mix) lib/mix/utils.ex:376: Mix.Utils.read_path/2
(mix) lib/mix/local.ex:139: Mix.Local.read_path!/2
(mix) lib/mix/local.ex:118: Mix.Local.find_matching_versions_from_signed_csv!/2
(mix) lib/mix/tasks/local.hex.ex:29:
(mix) lib/mix/task.ex:300: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

Any ideas? Thank you for reading.

Have you set your erlang and elixir to global with asdf?

asdf global erlang 19.4
asdf global elixir 1.4.4

I think for particular project and particular version you need to mess with: asdf .tool-versions But I haven’t mess around with that much.

1 Like

When compiling Erlang via asdf, you need to have openssl development packages available on your system.

1 Like

Thank you for the fast reply. I had them set to local, however switching to global didn’t change anything.

NobbZ state that your problem seems to be openssl package.

Maybe this will help:

1 Like

Yes, it was complaining on about openssl.

asdf install erlang 19.3
Extracting source code
Building Erlang/OTP 19.3 (asdf_19.3), please wait…
APPLICATIONS DISABLED (See: /home/noname/.asdf/plugins/erlang/kerl-home/builds/asdf_19.3/otp_build_19.3.log)

  • crypto : No usable OpenSSL found
  • ssh : No usable OpenSSL found
  • ssl : No usable OpenSSL found

Erlang/OTP 19.3 (asdf_19.3) has been successfully built

I have the libssl-dev package installed. Is that what you mean by openssl development packages or is it something else.

Have you installed it prior to compiling OTP or only afterwards?

It needs to be available on your system when you do asdf install erlang ....

I can’t say though whether or not that is the correct package. My Linux distribution bundles headers and libraries in the same package and does not do this artificial separation that many of the mainstream distros do.

If you have installed the development headers only after you have installed Erlang, you’ll need to remove it and reinstall using asdf.

1 Like

I had it before installing erlang. mythicalprogrammer shared a stockoverflow link that seems to state my problem. I have trouble uninstalling erlang right now, I will give that a try once I can. Thank you for your time.

This is my go to when installation mess up.

asdf plugin-remove erlang
asdf plugin-remove elixir
asdf plugin-add erlang
asdf plugin-add elixir

Sorry for the delay. Defining openssl path with “–with-ssl” flag didn’t solve my problem. After further digging, I found out that erlang 19.x doesn’t work with openssl 1.1.x. I found some patch files for making erlang 19.x work with openssl 1.1.x. I will give that a try. Thank you for your help.

Patching erlang 19.3 up to be used with openssl 1.1.x didn’t work for me.

This is my solution:
//install openssl 1.0

curl  | tar xfz - && cd openssl-1.0.2r && ./config --prefix=/usr/local/openssl-1.0.2r -fpic && make && sudo make install && cd .. && rm -rf openssl-1.0.2r creates=/usr/local/openssl-1.0.2r

//tell asdf/kerl where to find it (the “–with-ssl” flag)
KERL_CONFIGURE_OPTIONS="–disable-debug --without-javac --with-ssl=/usr/local/openssl-1.0.2r"

I am running Ubuntu 18.04 (on windows subsystem linux) with all the current updates.

I hope this will be usefull for others as well. I wan’t to thank mythicalprogrammer and NobbZ for their help. I wouldn’t know where to start otherwise.

1 Like

Correction: It should be

export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac --with-ssl=/usr/local/openssl-1.0.2r"

we are setting an environment variable. You should unset it afterwards.

1 Like