Problems about installing ruby from source on linux

Hi all,

I'm trying to install ruby/ruby on rails from source on ubuntu 7.1. I've downloaded ruby-1.8.6 and done a successful install into /usr/ local/ruby. Next, I want to install rubygems without apt-get. So I downloaded rubygems, extracted it and tried to run ruby setup.rb. But it said that cannot load file "zlib". I know that zlib is a part of the standard ruby distribution and I can find it in [ruby_sourc_path]/ ext/zlib, but it seems that it wasn't installed into /usr/local/ruby as I expected.

I found a file called extmk.rb in [ruby_source_path]/ext and thought this could help. So I tried to run ruby extmk.rb, but it said that cannot load "rbconfig".

There is an aritcle on the internet saying that I can run extconf.rb in [ruby_sourc_path]/ext/zlib and then do a make && make install. This works for me, but before I can run extconf.rb, I must install zlib-1.2.3 manually.

Another problems is that the above approach can only install zlib. What if I want to install the whole ruby/ext? I think extmk.rb is the point but I just cannot run it successfully?

Any idea on this? Thanks a lot.

allen