A quick and easy step-by-step guide to get your Ruby environment up and running again after a fresh install of Mountain Lion. I messed up my installations a few times and figured I'd just put out a Gist once and for all to get this sucker working in one go.
First go ahead and install either XCode to get ahold of the Command Line Tools. Or, if you prefer not to install XCode, simply download the latest version directly. This only requires you to provide your Apple ID and password to sign in. You do not need a developers license.
- Or install them through XCode via the preference panel
Should you mess up the installation order or come across permission or other errors, try the following:
sudo chown -R $(whoami) /usr/local
brew update
Just run these commands if you're unsure.
Next, install the apple-gcc42
through Homebrew in order to be able to install Ruby versions older than 1.9.3
:
brew tap homebrew/dupes
brew install apple-gcc42
Ruby 1.8.7 will not compile with the default options. In order to properly compile Ruby 1.8.7 or Ruby Enterprise Edition (REE) with RVM, issue the following commands:
rvm install 1.8.7 --without-tcl --without-tk
rvm install ree --without-tcl --without-tk