DEV Community

phathdt for OnPoint Vietnam

Posted on • Edited on

Installing Erlang & Elixir on M1 Macs

This week I have a new macbook pro M1, an amazing computer. After several times install erlang and elixir with but dont have any luck. Then I have a solution is install erlang by brew, then reshim to asdf, this solution was suggested by this comment on GitHub

I assume you have installed asdf already, but here is the full installation command I use

brew install asdf autoconf wxmac openssl@1.1 fop coreutils automake libyaml readline libxslt libtool unixodbc unzip curl
Enter fullscreen mode Exit fullscreen mode

Please note that you should install and using openssl@1.1 because Erlang doesn't support openssl 3 yet. If you already install the latest version, please try unlink and link version openssl@1.1

brew unlink openssl@3 
brew link openssl@1.1
Enter fullscreen mode Exit fullscreen mode

Next is add plugin erlang asdf

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
Enter fullscreen mode Exit fullscreen mode

Now you are ready to install Erlang 24 and Elixir 1.12.3 using brew and reshim to asdf

brew install erlang@24 
cp -r /opt/homebrew/opt/erlang@24/lib/erlang ~/.asdf/installs/erlang/24.1.7
asdf reshim erlang 24.1.7
asdf global erlang 24.1.7 
asdf install elixir 1.12.3-otp-24
asdf global elixir 1.12.3-otp-24
Enter fullscreen mode Exit fullscreen mode

to install another version ( 23 for me )

brew unlink erlang@24 
brew install erlang@23 
cp -r /opt/homebrew/opt/erlang@23/lib/erlang ~/.asdf/installs/erlang/23.3.4.9
asdf reshim erlang 23.3.4.9
asdf global erlang 23.3.4.9 
asdf install elixir 1.10.4-otp-23
asdf global elixir 1.10.4-otp-23
Enter fullscreen mode Exit fullscreen mode

Please remember switch version erlang before install elixir

after these step, you can use asdf to switch version erlang instead of using brew

PS: you could check detail version erlang install brew at this
PS: you could try update to Mac Monterey, it will fix some issue with rosetta

Oldest comments (2)

Collapse
 
zacky1972 profile image
Susumu Yamazaki

Hi,
Erlang 24.2, which was released Dec 16, 2021, supports OpenSSL 3.0, but when installing using Homebrew, it is linked only to OpenSSL 1.1. If you want to get Erlang 24.2 linked to OpenSSL 3.0, install it by asdf. I wrote an article, including this point:

dev.to/zacky1972/perfect-steps-of-...

Collapse
 
rubikill profile image
Toan Ha