Open Xcode. Click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".
$ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ mkdir -p ~/.rbenv/plugins
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ source ~/.bash_profile
$ env CC=/usr/bin/gcc rbenv install 1.9.3-p362
$ rbenv global 1.9.3-p362
$ rbenv rehash
$ ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-darwin12.2.1]