Before we start read this guide:  Be sure to add the extra repositories, if you haven't yet.
Here are a bunch of commands that I executed to get Ruby built.
apt-get install build-essential
apt-get install bison byacc gperf
apt-get install zlib1g-dev
apt-get install libreadline5 libreadline5-dev
apt-get install libncurses5 libncurses5-dev temcap-compat
apt-get install libssl-dev
If you have previously tried to build it, then rm -rf ruby-1.8.4 and tar zxvf ruby-1.8.4.tar.gz; cd ruby-1.8.4; ./configure; make; sudo make install
Retest in your rails app: script/console. Everything should work.
The last install is for openssl development headers and libs. This is a Rake dependency in certain cases. (Not Rails specific.)