A checklist I follow when setting up a new Mac's development environment.
- Update OS
- Download and install latest version of Xcode from the Mac App Store. (if needed)
- Install Xcode Command Line Tools by running:
xcode-select --install
sleep 1
osascript <<EOD
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
click button "Agree" of window "License Agreement"
end tell
end tell
EOD
Show hidden files
- Run
defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder
See my dotfiles
During this process, you will setup your dotfiles, install global npm packages, and install non Mac App Store apps all via Homebrew. #magic
https://cli.github.com/manual/.
- Run
gh auth login
Install Oh My ZSH! via curl
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Note: many themes require installing the Powerline Fonts in order to render properly.
Clone powerline fonts repo:
$ git clone https://github.com/powerline/fonts.git --depth=1
Install them:
$ cd fonts
$ ./install.sh
Delete
$ cd ..
$ rm -rf fonts
Update plugins and theme
$ vi ~/.zshrc
plugins=( git bundler dotenv macos rake rbenv ruby )
ZSH_THEME="agnoster"
Install NVM by running this:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Then, run this:
$ source ~/.nvm/nvm.sh
Get list of versions:
$ nvm list-remote
Install the version you want:
$ nvm install 18
$ nvm use 18
Or just install latest version:
$ nvm install stable
rbenv was installed in step 3, now set the version. Via: https://gorails.com/setup/osx/12-monterey.
# Add rbenv to bash so that it loads every time you open a terminal
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
$ source ~/.zshrc
# Install Ruby
$ rbenv install 3.0.2
$ rbenv global 3.0.2
$ ruby -v
Fork this repo, or just copy-paste things you need, and make it your own.
Works for me, may not work for you.