8

I tried to install Elixir on my M1 mac using brew, as explained here. After installation, elixir --version returns segmentation fault elixir --version..

After reading this, I tried the suggested changes, updated the files and ran brew reinstall elixir, but I still get the same segmentation fault elixir --version..

Does anyone have an idea how to get this up and running with (some recent version of) Elixir on a M1 mac? (MacBook Air (M1, 2020) Apple M1 16 GB)?

Raed Ali
  • 549
  • 1
  • 6
  • 22
Sventies
  • 2,314
  • 1
  • 28
  • 44

1 Answers1

10
  1. Install asdf.
  2. Install the erlang plugin.
    • Make sure to read the "Before asdf install" section.
    • The "Getting Erlang documentation" section is good to know too.
      TLDR: export KERL_BUILD_DOCS="yes"
    • asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
  3. asdf install erlang latest + wait for erlang to build.
  4. asdf global erlang latest
  5. Install the elixir plugin.
    • asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
  6. asdf install elixir latest
  7. asdf global elixir latest
  8. iex to test. Done!

Bonus: export ERL_AFLAGS="-kernel shell_history enabled" to get shell history in iex.

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
  • Even after following the steps the Elixir version stays the same. I wanted to downgrade elixir version globally, followed the steps but elixir --version returns the same version. - M2 Mac – manuka_m Jul 11 '23 at 09:34
  • 1
    @manuka_m you probably have something in earlier in your `PATH` overriding the settings. – Adam Millerchip Jul 11 '23 at 09:46
  • @AdamMillerchip need help, followed above steps, mix command throws error, detailed error here https://stackoverflow.com/q/76844553/11141189 – Bhanwarlal Chaudhary Aug 06 '23 at 14:44