Mark Karavan
Mark Karavan

Reputation: 2674

Trouble installing elixir 1.5 on OSX

I have erlang 19 installed on my local machine.

$ erl -s
>> Erlang/OTP 19 [erts-8.3] [source-d5c06c6] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

I install elixir with homebrew

$ brew install elixir
==> Downloading https://homebrew.bintray.com/bottles/elixir-1.5.1.sierra.bo
Already downloaded: /Users/mkaravan/Library/Caches/Homebrew/elixir-1.5.1.sierra.bottle.tar.gz
    ==> Pouring elixir-1.5.1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/elixir/1.5.1: 400 files, 5MB

I get an error when checking the elixir version:

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

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

How do I install elixir 1.5?

EDIT: I do not remember how I installed Erlang. I have tried to remove it with homebrew, but come up with this error:

$ brew uninstall --force erlang
Uninstalling erlang... (5,211 files, 259.7MB)
Error: Permission denied - /usr/local/Cellar/erlang/19.3/lib/erlang/lib/ic-4.4.2/java_src/com/ericsson/otp/ic/Any.java

I have tried sudoing Any.java and chmoding it, but to no avail.

Upvotes: 1

Views: 748

Answers (1)

jamescheuk
jamescheuk

Reputation: 440

You need to look at the erl_crash.dump to find out more info.

It happened most likely because the Erlang version that you use to compile the elixir binary is different the version you have installed. It seems that you have two erlang versions inside your systems.

The best course of action is to remove all versions of Elixir and Erlang.

Version Manager Suggestion for erlang and elixir:

asdf

https://github.com/asdf-vm/asdf

asdf setup:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.3.0

# OR for Mac OSX and default shell
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile

add Erlang and Elixir as asdf plugin

asdf plugin-add erlang
asdf plugin-add elixir

install Erlang and Elixir

asdf install erlang 20.0
asdf install elixir 1.5.1

set Erlang and Elixir global version

asdf global erlang 20.0
asdf global elixir 1.5.1

Upvotes: 2

Related Questions