Lots of our commonly-used OSX development tools have been updated to support Apple's new bespoke silicon, but a few remain incompatible, and it's challenging to work around them individually. In my recent experience several approaches were attempted to work around this - below is the approach we found most consistently successful.
Apple provides a tool called Rosetta2 which provides a full emulation layer for any Intel code you might want to run on their new architecture. It's awkward to run each tool we use under emulation individually, though - our approach here is to start our top level process (a terminal app) under emulation, and run all our tools and processes subordinate to that.
- Install Rosetta2.
softwareupdate --install-rosetta
. - Choose / Install a suitable terminal program. OSX comes with the
Terminal
application - but consider using the much more fully featurediTerm2
instead (available from Homebrew viabrew install --cask iterm2
.) - Verify your archictecture. Open your terminal app and run
uname -m
- for an M1 processor you should seearm64
. - Open you Applications folder and make a copy of your terminal app. Rename it to reflect that it'll be running via emulation - "iterm2 - emulated", for example.
- Update settings to run the new app under emulation. Right-click on the new app and choose 'Get info'. In the 'General' panel check the "Open using Rosetta" option.
- Verify your architecture. Open your terminal app and run
uname -m
- With emulation active you should seex86_64
. - Install the rest of your tools in this terminal. tools installed from Homebrew, RVM, NVM, etc - everything that tries to do native compilation should be run from inside this terminal. Then anything that uses these tools - Rails processes, etc, should also be run from inside this terminal.