Just finished setting up a dev environment from scratch on a factory-reset MacBook. I used Homebrew for everything I could. Not saying this is the best approach, but that’s my step-by-step:
If new installs don’t show, update shell during steps source .zprofile
Install dependencies with Homebrew
brew install git
brew install rbenv
rbenv install ruby 3.4.6
rbenv global 3.4.6
ruby --version
gem update
gem install rails
rails --version
brew install postgresql@14 pgvector
brew services start postgresql
brew install redis
brew services start redis
brew install nvm (see nvm — Homebrew Formulae for shell profile adjustments)
nvm --version
nvm install 22
node -v
brew install pnpm
Install Discourse
Same as op, starting at Clone Discourse
postgres errors
Postgres installation seems a bit fragile. Apparently you can end up with corrupted files and a rather easy approach then is to delete them and install again:
brew uninstall postgresql@14
rm -rf /opt/homebrew/var/postgresql@14
brew install postgresql@14
brew services start postgresql@14