-
For the first step, there are two options. Choose option A if you plan on developing for iOS. Choose option B to avoid installing several GB of unnecessary software.
a. Install Xcode 4.5 (it can be found in the App Store)
In Xcode preferences go to the "Downloads" tab and under "Components" push the "Install" button next to "Command Line Tools" (StackOverflow)
b. Install [Command Line Tools](https://developer.apple.com/downloads) for Xcode 4.5 separately)
*Note: You will need an Apple ID for downloading Command Line Tools*
-
Install XQuartz
-
Run this command to set the correct path for the X11 library for the compiler:
$ export CPPFLAGS=-I/opt/X11/include -
Install Homebrew
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" -
Run brew doctor, follow directions
$ brew update $ brew doctor -
Install RVM version 1.15.0 (follow any post-install instructions)
$ rvm get 1.15.0 -
Satisfy requirements (
rvm requirements)$ brew update $ brew tap homebrew/dupes $ brew install autoconf automake apple-gcc42 $ rvm pkg install openssl -
Cleanup the RVM temp directory if you already tried installing Rubies
$ rvm cleanup all -
Ready to go. Now to install a Ruby interpreter:
First try:
$ rvm install 1.8.7If that doesn't work, cleanup first
$ rvm cleanup allThen try:
$ CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7Want more Rubies? Check out:
$ rvm list known
Note: For some reason, on my machine, when installing 1.9.4 , I didn't need to specify the location of the compiler:
$ rvm install 1.9.4
This may not be the case for everyone.
Sources for steps 4 and 9: StackOverflow