I ran into a problem doing this on a Fedora Core 4 system on Amazon Web Services EC2. I had installed Ruby 1.8.6, downloaded rubygems-0.9.4 and ran 'ruby setup.rb'. I got an error like this:
LoadError: No such file to load -- zlib
The problem is that there is no zlib (compression) library installed in the underlying Linux
setup.
To fix the problem:
1: As root,
# yum install zlib-devel
2: Recompile ruby
# cd ruby-1.8.6
# ./configure
# make
# make install
3: Install rubygems
# cd ../rubygems-0.9.4
# ruby setup.rb