I just fixed this on my Windows WSL Ubuntu setup.
TL;DR
What I did:
sudo apt remove elixir
sudo apt-get install libssl-dev
asdf plugin-add erlang
asdf plugin-add elixir
asdf install erlang 26.1.1
asdf install elixir 1.15.6-otp-26
asdf global erlang 26.1.1
asdf global elixir 1.15.6-otp-26
Basically, the sudo apt
approach is broken. The way to test it is to git clone the ElixirLS repo and try to compile it.
mix deps.get
and then mix compile
If this works, there’s good bet that VSCode doing the same thing (compiling ElixirLS) will work and connect.
I removed the elixir install and reinstalled using the embedded elixir approach. - however there is a dependency (documented here: [WSL - mix deps.get] The application "crypto" could not be found - #9 by thelucassampaio) - which is that you need to install libssl first and then use asdf to install-compile erlang and then elixir.
If this worked then the ElixirLS you cloned into a folder should compile. If not, see what error you are getting and go search - this is how I worked my way through this.
Only took 4 hours
It may not be the “correct” approach but at least it’s working for me now.