UPDATE IN PROGRESS:
Experimenting with this instead:
- rbenv versions
- rbenv uninstall x.y.z # uninstall all versions from the last step
- brew uninstall rbenv
- uninstalling homebrew
- removing postgres.app
- reinstall homebrew - not in rosetta 2
- brew install postegresql
- Then install rbenv and the latest ruby version
- brew services start postgresql
Original:
Uninstall the m1 version of rbenv:
brew uninstall rbenv
Completely uninstall homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Re-install homebrew using the x86 architecture version because apparently the pg gem will only compile with this version, which means rosetta2 has to be enabled
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then we installthe x86 version of rbenv
arch -x86_64 brew install rbenv
Then configure it to use ruby version 3.0.0 (that’s what version my M1 Mac is using) - FYI this only worked as sudo
sudo arch -x86_64 rbenv install 3.0.0
Give access to the ~/.rbenv folder so you don't have to use sudo:
chmod -R 777 ~/.rbenv
Then we configure rbenv for that version
rbenv global 3.0.0
sudo rbenv rehash
Then we install rails
gem install rails --pre
sudo rbenv rehash
is this still valid? do we need all of this currently?