This post will walk you through the process I used to get my machine setup for rails development on macOS High Sierra. We’ll start by performing a clean install of High Sierra to avoid any upgrade rust. Afterward we’ll install the development tools and some useful utilities. Enjoy!

Install High Sierra

⚠️ Backup your data BEFORE following these steps!

In order to complete this section you’ll need access to a 16+GB thumb drive. You’ll also want to print this or open it on another device before you start.

Get the installer

Download High Sierra from the AppStore. Quit the installer when it launches.

Create a bootable image

In the command below I’ve used the name of my USB drive which is TINY. It is likely that your drive has a different name so update the command accordingly.

Open terminal and run the following command

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/TINY

This command took about 14 minutes to complete on my machine.

Erase and Install

⚠️ Last Warning! Be sure you have a backup before erasing your data!

Reboot your Mac and when it’s turning back on hold down ⌘ + R until you see the Apple logo. Eventually macOS Utilities will open. Select Disk Utility. On the left you’ll see a list of drives. Select your hard drive (e.g., Macintosh HD) and from the top toolbar select Erase. Once the erase has finished, quit Disk Utility.

You should be taken back to the macOS Utilities screen. Select Install macOS, selected your hard drive and follow the wizard.

Install Useful utilities

Homebrew

https://brew.sh/

This is the “missing package manager for macOS” and we’ll use it to install most of the other stuff.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install some dev packages:

brew install coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

Cask

https://caskroom.github.io

This allows us to lean on Homebrew to install applications for us.

brew tap caskroom/cask

Install the following:

  • Google Chrome brew cask install google-chrome
  • iterm2 brew cask install iterm2
  • atom - brew cask install atom

asdf

https://github.com/asdf-vm/asdf

This is a version manager much like rbenv but not limited to ruby.

v0.4.0 was the latest as of this writing. This also assumes your just using Bash.

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile

You may have to restart your shell before proceeding.

Install the ruby plugin:

asdf plugin-add ruby

Install Ruby

asdf install ruby 2.4.2
asdf global ruby 2.4.2

Install Rails

gem install rails -v 5.1.4

Install Postgres

brew install postgresql
brew services start postgresql