Installing Ruby from source is my preferred method, although in Ubuntu Feisty you can supposedly install it with apt-get install ruby now. Here’s the essential packages needed to get a source build working right though and the process I just went through:
sudo apt-get install build-essential
sudo apt-get install libreadline-dev
sudo apt-get install libz-dev (this is necessary for RubyGems to install - amongst other things)
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz (或sudo apt-get install ruby-full,sudo apt-get install ruby1.9.1-full)
tar xzvf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure
make
make install
And to install RubyGems..
wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
tar xzvf rubygems-0.9.2.tgz
cd rubygems-0.9.2
ruby setup.rb