, , , ,

Moving between jobs and setting up new machine can be quite painful at times, I recently moved into new assignment and faced the challenge so to avoid pain for other just summarising the steps I followed for smooth Installation.

1. Install Xcode and the Command Line Tools

If you don’t have Xcode installed I suggest to install Xcode from the Mac App Store and install the command line tools in Xcode Preferences -> Downloads.


2. Install Homebrew

Now, run brew doctor to check everything is as expected before we continue.:

  • brew doctor

If you get error: No such file or directory – /usr/local/Cellar

Run the following:

  1. sudo mkdir /usr/local/Cellar
  2. sudo chown -R `whoami` /usr/local

3. Install RVM

  • curl -L get.rvm.io | bash

After this is complete, execute the following in order to use RVM in your current shell

  • source ~/.rvm/scripts/rvm

4. Setup ~/.profile

Add the following to your ~/.profile in order to source RVM everytime you run Terminal.app:

  • [[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm”

5. Check RVM Requirements

  • rvm requirements

If you have any missing required packages you will need to install them before continuing by running brew install .

If you need to install apple-gcc42 and get an error:  No available formula for apple-gcc42

Run the following:

  • brew tap homebrew/dupes

If you get an error after running this: Already tapped!

Instead of repairing, run the following:

  • brew tap –repair homebrew/dupes

Now you can continue and install apple-gcc42:

From the “Missing required packages: …” line above, for example I can now execute the following:

  • brew install autoconf automake libtool pkg-config apple-gcc42 libyaml readline libxml2 libxslt libksba openssl sqlite

6. Run brew doctor again to make sure everything checks out

Execute the following:

  • brew doctor

If you get an error or warning about your PATH. Such as:

  • Warning: /usr/bin occurs before /usr/local/bin

Open your ~/.profile and add the following line to the top (or bottom, it shouldn’t matter):

  • export PATH=/usr/local/bin:$PATH

Or Augment your .bash_profile to have

  • export PATH=”/usr/local/bin:/usr/local/sbin:~/bin:$PATH”

Now run: brew doctor

7. It’s now time to install Ruby 2.0.0:

First run the following commands:

  • rvm get head

followed by:

  • rvm requirements

If you don’t get any errors you can finally install Ruby 2.0.0:

  • rvm install 2.0.0

To set as your current version of Ruby run the following command:

  • rvm use 2.0.0

To make it the default Ruby:

  • rvm default 2.0.0

Now every time you open Terminal.app Ruby 2.0.0 will be default. You can always check which version of Ruby you have using the following command:

  • ruby -v

and where it’s located executing the command:

  • which ruby

You are now setup to run Ruby 2.0.0 on Mac OS X 10.8 Mountain Lion.