$ xcode-select --install
Install applications
$ brew install iterm2 # basic terminal
$ brew install --cask warp # different terminal
$ brew install git
$ brew install git-recent
# Browsers
$ brew install --cask firefox
$ brew install --cask google-chrome
$ brew install --cask brave-browser
# Editors
$ brew install --cask visual-studio-code
$ brew install --cask rubymine
# Helpful apps
$ brew install bat # a better cat
$ brew install ag # Silver Searcher; a faster grep
$ brew install --cask spotify
$ brew install --cask postman # API client
$ brew install --cask paw # different API client
$ brew install --cask rectangle # excellent window manager
$ brew install fzf # fuzzy find, better terminal recall
$ $(brew --prefix)/opt/fzf/install
# maybes
$ brew install httpie # a better curl
$ brew install tldr # summarise articles
$ brew install --cask clipy
Updates and Maintenance
$ brew update
$ brew upgrade
$ softwareupdate --install --all
$ brew cleanup
OTHERS:
$ git config --global user.name "Your Real Name"
$ git config --global user.email me@example.com
$ git config --global core.editor code --wait
$ git config --global core.excludesfile /Users/<username>/.gitignore_global
$ git config --global pull.rebase false
$ git config --global color.ui true
$ git config --global fetch.prune true
$ git config --global --add push.default current
$ git config --global --add push.autoSetupRemote true
$ git config --global --add merge.ff true
# when possible resolve the merge as a fast-forward (only update the branch pointer to match the merged branch; do not create a merge commit)
$ git config --list
bash_prompt.bash
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Use Homebrew to install;
$ brew install rbenv ruby-build postgres redis cask
# and maybe these
$ brew install rbenv-gemset postgis shared-mime-info graphviz imagemagick
$ brew install fig # does not work with warp
$ fig
# and then pin;
brew pin postgresql
# run brew list --pinned to show pinned packages
https://gorails.com/setup/osx/12-monterey
$ gem install bundler
$ brew services start postgresql
(always start server)$ brew services start redis
(always start redis server)$ bundle config gems.contribsys.com <sidekiq-pro-key>
$ bundle install
$ psql -d <database_name> < path/dump_name.sql
$ bundle exec rails db:migrate
Get the latest database dump and insert it into your local dev database:
$ psql -d <database_name> < path/to/dump_name.sql
alternative:
$ psql -U db_user db_name < dump_name.sql
https://stackoverflow.com/questions/24627701/a-server-is-already-running-check-tmp-pids-server-pid-exiting-rails
Restarting rails server when crashed and still running;
$ rm /your_project_path/tmp/pids/server.pid
$ bundle exec rails server
https://stackoverflow.com/questions/36436120/fatal-error-lock-file-postmaster-pid-already-exists
$rm /opt/homebrew/var/postgresql/postmaster.pid
# M1 Mac
$rm /usr/local/var/postgres/postmaster.pid
# for older Mac
$rm $(brew --prefix)/var/postgres/postmaster.pid
# for either? untested$ brew services restart postgresql
$ brew services restart redis