How to fix elixir and erlang version mismatch?

Hi, I need some help again.


❯ elixir --version
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

❯ asdf list erlang
  22.0.7
  23.2.7

❯ asdf list elixir
  1.11.3-otp-23
  1.9.1-otp-22

Using macOS BigSur, I have tried many methods/solutions googled to make :observer.start work, but, failed. After then, this trouble happens like;

❯ mix new pub_sub_demo --sup
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

erlang version shows.

❯  erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().'  -noshell
"22"

Any advices shall be appreciated.

Thanks! :smiley:

So you are using asdf to manage versions and you want to use the matching erlang and elixir in one project?

Try to create a file .tool-versions in your folder (or if you want in your user home directory) and put there:

erlang 23.2.7
elixir 1.11.4-otp-23

Then run asdf install

1 Like

It works. Thank you, egze.