Install XCode The one at Apple Store says (Compatibility: OS X 10.8.4 or later) so you may have to dig up your installation disk to find Xcode compatible with your OS.
Install a newer version of Ruby than the one that comes with MacOS. This is a nice tutorial for installing ruby. You'll end up with RVM, XCode, and eventually Ruby version 1.9.2.