0

after upgrading Elixir and Erlang 26 with homebrew, installing Phoenix causes a segmentation fault:

$ mix archive.install hex phx_new
Resolving Hex dependencies...
Resolution completed in 0.017s
New:
  phx_new 1.7.7
* Getting phx_new (Hex package)
All dependencies are up to date
Compiling 11 files (.ex)
Segmentation fault: 11

How can this be fixed?

Tilo
  • 33,354
  • 5
  • 79
  • 106
  • Does this answer your question? [Install elixir on M1 mac](https://stackoverflow.com/questions/70993494/install-elixir-on-m1-mac) – Adam Millerchip Jul 24 '23 at 23:33

1 Answers1

1

after some digging, I found that homebrew was configured for x86 architecture with Rosetta active, instead arm64.

To check your CPU architecture, run uname -m

$ uname -m 
arm64

Check your homebrew configuration:

$ brew config
...
macOS: 13.4.1-x86_64
CLT: N/A
Xcode: 14.3
Rosetta 2: true

to switch it to arm64, run:

eval "$(/opt/homebrew/bin/brew shellenv)"

then verify that the architecture is configured correctly:

$ brew config
...
macOS: 13.4.1-arm64
CLT: N/A
Xcode: 14.3
Rosetta 2: false

Then reinstall Elixir and Erlang

brew reinstall elixir erlang

and install Phoenix via mix archive.install hex phx_new

Tilo
  • 33,354
  • 5
  • 79
  • 106