[WSL - mix deps.get] The application "crypto" could not be found

I’m using WSL (Ubuntu 20.06) with asdf trying to run an Elixir/Phoenix project that has recently updated all of its packages.
My versions are erlang 25.3 and elixir 1.15.4-otp-25. I’m trying to run mix deps.get and the error I get reads:
** (Mix) The application "crypto" could not be found. This may happen if your Operating System broke Erlang into multiple packages and may be fixed by installing the missing "erlang-dev" and "erlang-crypto" packages

I have tried installing the mentioned packages, but I get that they are already installed. (erlang-crypto is already the newest version (1:22.2.7+dfsg-1ubuntu0.2). erlang-dev is already the newest version (1:22.2.7+dfsg-1ubuntu0.2). 0 upgraded, 0 newly installed, 0 to remove and 392 not upgraded.

Any thoughts on what might be the issue?

Are you sure that you are using ASDF-installed Erlang?

I have ran sudo apt-get purge erlang* in case there were any versions coming from Linux. The error persisted. However, I don’t know if that’s enough to make sure where my Erlang is coming from.

What is the output of which erl.

It’s /home/lucas/.asdf/shims/erl

Make sure that when you compile OTP (when installed with asdf), you don’t have crypto listed in your disabled applications.

The reason crypto was not compiled is most probably because you are missing openssl, however you should check the details when OTP is built.

1 Like

How do I check if crypto is listed on disabled applications?

When you install OTP with asdf, it will compile it from source, the configure will run and display a message of disabled OTP libraries and the reason.

This was it!

I uninstalled Erlang with ASDF and installed it again. It in fact displayed the disabled applications. What I got was:

Building Erlang/OTP 25.3 (asdf_25.3), please wait...
WARNING: It appears that a required development package 'libssl-dev' is not installed.
WARNING: It appears that a required development package 'libncurses5-dev' is not installed.
APPLICATIONS DISABLED (See: /home/lucas/.asdf/plugins/erlang/kerl-home/builds/asdf_25.3/otp_build_25.3.log)
 * crypto         : No usable OpenSSL found
 * jinterface     : No Java compiler found
 * odbc           : ODBC library - link check failed
 * ssh            : No usable OpenSSL found
 * ssl            : No usable OpenSSL found

I did have OpenSSL installed (OpenSSL 1.1.1f 31 Mar 2020), though.

Anyhow, upon unistalling Erlang with ASDF again, I ran sudo apt-get install libssl-dev. Installed Erlang one last time and everything worked.

Thank you all so much!

1 Like