The compiler that comes with Xcode doesn’t work with ruby.
You need to install the version of gcc that works with it and set up a symlink.
I’m on a plane so I don’t have the details with me. Google a bit and you should find blog entries with details.