RVM, Lion and XCode 4.2

Maybe the dullest subject line ever but it took me a while to get Ruby 1.9.3 installed on my laptop and so here to help me in the future is the secret sauce.

This is all on a Lion based machine (clean build, not an upgraded machine)

Download and install XCode from the AppStore (Which is easier these days now that the latest version actually installs itself, rather than just downloads.
Install RVM:
$ bash << (curl -s https://rvm.beginrescueend.com/install/rvm)

Update your .bash_profile
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" ' >> ~/.bash_profile

Reload .bash_profile (or close and re-open terminal)
$ source .bash_profile

Install Ruby 1.9.3
$ rvm install 1.9.3 --with-gcc=clang

Set Ruby 1.9.3 to be your default
$ rvm --default 1.9.3

And check using
$ ruby -v

And then install Rails
$ rvm install rails

Update: Since originally writing this post I've switched to using JewelryBox instead, a nice GUI that makes the whole process a lot easier. (Especially if you need to develop off different versions of Ruby for whatever reason)