Beginner - iex will not load

I’m an Elixir noob and have Erlang v20 and Elixir v1.5 installed on OSX 10.12.6.

When attempt to run iex I receive the following error message in a terminal window:

=ERROR REPORT==== 31-Jul-2017::12:02:31 ===
Loading of /usr/local/Cellar/elixir/1.5.0/bin/…/lib/elixir/ebin/elixir.beam failed: badfile
{“init terminating in do_boot”,{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ()

Should I do an unistall and then reinstall the Erlang and Elixir? Any thoughts would be greatly appreciated.

This error is common when you the erlang version used to compile the elixir binary didn’t match the version you have installed.

Please downgrade erlang to OTP 19 until homebrew distributes an elixir compiled via 20.

This error is common when you the erlang version used to compile the elixir
binary didn’t match the version you have installed.

Please downgrade erlang to OTP 19 until homebrew distributes an elixir
compiled via 20.

Uh, what? I’m running brew-installed Erlang/OTP 20 + Elixir 1.5.0
on a Mac withe the same OS with no issues.

Then maybe reinstalling both in the order erlang, then elixir will suffice, I’m not a mac user, but I recognize that error, also there have been issues because of this mentioned in the forum before.

Sierra 10.12.6
Erlang via Erlang installer for OS X 0.9.4 Build 1 (here via download)
Elixir 1.5.0 via homebrew

No issues

$ iex
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [kernel-poll:false]
...
Interactive Elixir (1.5.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

Erlang was installed before Elixir.

Please reinstall erlang via brew or elixir via esl package if available. It has never worked very well to mix packaged installs with manual ones. Especially if the packaged software depends on a manually installed…

… i.e. if Erlang is manually installed:

elixir-lang.org - Precompiled package:

Elixir provides a precompiled package for every release. First install Erlang and then download and unzip the Precompiled.zip file for the latest release.

Once the release is unpacked, you are ready to run the elixir and iex commands from the bin directory, but we recommend you to add Elixir’s bin path to your PATH environment variable to ease development.

Thanks to all for the help on this topic.

I uninstalled both Erlang and Elixir via HomeBrew and found that older versions had not been removed previously. I removed all versions of both pieces of software and then reinstalled Erlang and Elixir in that order. Things appear to be working well and I can get on with the learning process. Again, thanks to all for the quick responses.

1 Like