this is a micro-guide how to easily develop Rack x86 on M1 arm64 arch based Macs.
Open iTerm2 or Terminal app and switch to x86 version of zsh:
arch -x86_64 zsh(I made an alias for this, for easy switching)
Install brew (it does not matter, if you already installed brew on a arm64 terminal)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Now you have an own x86 installation of brew at:
# arch and homebrew setup PATH_BREW_X86_64="/usr/local/Homebrew/bin" PATH_BREW_ARM64="/opt/homebrew/bin" if [[ $(arch) = "arm64" ]]; then # add your own arm64 specific stuff here export PATH="$PATH_BREW_ARM64:$PATH" else # add your own x86 specific stuff here export PATH="$PATH_BREW_X86_64:$PATH" fi
This should behave like a normal Intel Mac installation, I did not encounter any issues so far, Rosetta2 is a great and robust thing. You may add a hint or something to your prompt on which arch you are currently, or use a different Terminal for this - else things may get confusing. (I added a small prefix to my zsh prompt which says arm or x86.)
I hope this helps M1 loving developer who struggled with such issues. It has been written down out of my memory, so I hope it is correct, let me know if there are any issues.