Skip to content

Instantly share code, notes, and snippets.

@alandotcom
Created October 3, 2012 05:13
Show Gist options
  • Select an option

  • Save alandotcom/3825148 to your computer and use it in GitHub Desktop.

Select an option

Save alandotcom/3825148 to your computer and use it in GitHub Desktop.
Install RVM and Rubies on OSX Mountain Lion
  1. 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*
  1. Install XQuartz

  2. Run this command to set the correct path for the X11 library for the compiler:

    $ export CPPFLAGS=-I/opt/X11/include
    
  3. Install Homebrew

    $ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
    
  4. Run brew doctor, follow directions

    $ brew update
    $ brew doctor
    
  5. Install RVM version 1.15.0 (follow any post-install instructions)

    $ rvm get 1.15.0
    
  6. Satisfy requirements (rvm requirements)

    $ brew update
    $ brew tap homebrew/dupes
    $ brew install autoconf automake apple-gcc42
    $ rvm pkg install openssl
    
  7. Cleanup the RVM temp directory if you already tried installing Rubies

    $ rvm cleanup all
    
  8. Ready to go. Now to install a Ruby interpreter:

    First try:

    $ rvm install 1.8.7
    

    If that doesn't work, cleanup first

    $ rvm cleanup all
    

    Then try:

    $ CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7
    

    Want 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment