Tuesday, September 8, 2020

How to manage Erlang and Elixir versions on Mac or Linux to fix a vscode debugger incompatibility issue with elixir-ls

VSCode issue:

Started ElixirLS debugger v0.5.0

Elixir version: "1.10.2 (compiled with Erlang/OTP 21)"

Erlang version: "22"

ElixirLS compiled with Elixir 1.7.4 and erlang 20

WARNING: Debugging is not supported on Elixir 1.10.2. Please upgrade to at least 1.10.3

more info: https://github.com/elixir-lsp/elixir-ls/issues/158


asdf Version/Package manager
https://medium.com/juq/how-to-manage-elixir-versions-on-mac-or-linux-getting-started-with-elixir-12308e7b6451

https://thinkingelixir.com/install-elixir-using-asdf/

https://alchemist.camp/episodes/asdf-language-versions

Compatible Erlang/Elixir versions 

https://hexdocs.pm/elixir/compatibility-and-deprecations.html

ELIXIR VERSION  SUPPORTED ERLANG/OTP VERSIONS
1.10                             21 - 22 (and Erlang/OTP 23 from v1.10.3)


Linux Version/Package manager
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
asdf update
source ~/.bashrc
asdf update
sudo apt install automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev
asdf plugin-add erlang
asdf plugin-add elixir
asdf list-all erlang
asdf install erlang 22.3.4.10
asdf list-all elixir
# select the version that is compatible wit the erlang version and 
# the compatible otp version for the erlang top that you selected 
# above. In this case we selected with OTP 22
asdf install elixir 1.10.3-otp-22
asdf global erlang 22.3.4.10
asdf global elixir 1.10.3-otp-22

VSCode works!

Started ElixirLS debugger v0.5.0

Elixir version: "1.10.3 (compiled with Erlang/OTP 22)"

Erlang version: "22"

ElixirLS compiled with Elixir 1.7.4 and erlang 20

Compiling 1 file (.ex)

Generated pm app

PmTest

  * doctest Pm.hello/0 (1)

  * doctest Pm.hello/0 (1) (0.1ms)

  * test greets the world

  * test greets the world (0.1ms)

Finished in 0.00 seconds

1 doctest, 1 test, 0 failures

Randomized with seed 285439



No comments:

Post a Comment