Thanks to Shigeya, who contributed the solution and it worked for me like a charm:
- Uninstall XCode.
- Install XCode 4.3.2 (by the time I put up this post) from Apple's App Store.
- Open a terminal, run 'sudo xcode-select -switch /Applications/Xcode.app'.
- Open XCode, go to 'Xcode -> Preferences -> Components', install 'Command Line Tools'.
- Install RVM from master branch, or run 'rvm get head' if you've installed RVM.
- Install Ruby 1.9.3-p125 using RVM.
You should be able to install Ruby with no problems now. If not, you might want to do what RVM suggests: