The latest Xcode and Command Line Tools for Xcode changes the default compiler from gcc to the llvm compiler. Only ruby-1.9.3-p125+ is LLVM ready. So, you will have to install gcc-4.2 to compile older versions of Ruby. More detail here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers.
This worked for me. I hope it saves some people time:
brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/apple-gcc42.rb
CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7