Before you begin to install Ruby from source on Ubuntu you need to make sure you have the following packages installed:
$ apt-get update $ apt-get -y install build-essential zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev sqlite3 libsqlite3-dev locate git-core libssl-dev openssl $ apt-get -y install curl wget
Next you need a copy of the Ruby source code (either 1.8.7 or 1.9.x). Uncompress the file and move into the directory and type:
$ ./configure $ make $ sudo make install
Then to install Rubygems you uncompress the file, move into the directory and type:
$ sudo ruby setup.rb
If you don’t install libz-dev your Rubygems will be broken. Make sure you have all the necessary libraries and the latest build tools before you make your own Ruby from source!
Why would you want to do this? The obvious answer is if you’re using Linux. Another reason might be the little known fact that Ruby/Rails performs better on a VirtualBox Ubuntu 8.10 than it does in Vista (no surprises there). Most of us deploy to Linux platforms anyhow – so if you have to develop on Windows, I’d go with the VirtualBox set-up.

Thanks for the post. I always forget the dependencies.
you forgot the libreadline-dev dude.
The console doesn’t work without it.