This method is depricated and has been replaced by an automated installer. See this post for more details:
Setting up Ubuntu 11.10 for Rails development… Just Right!
The setup for Ubuntu 11.10 almost identical to the 11.04 setup. A few libraries have changed but otherwise it’s exactly the same.
As before, I like to have a system Ruby installed. This has always been a precautionary measure but has saved me plenty of pain with past installs.
sudo apt-get install build-essential openssl ri ruby ruby1.8 ruby-dev rake libruby1.8 git-gui gitk libxslt1-dev libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
Then install RVM (see the RVM website for the latest installation instructions).
$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Then run the following command, and… READ THE NOTES!
Make sure you read the RVM post-installation notes. You will get an updated list of OS dependencies and instructions on how to modify your .bash file. If you don’t do this you will probably drive yourself crazy trying to get RVM to work. You will fail.
Finally, install whatever rubies you want:
rvm install 1.8.7 rvm install 1.9.2 rvm install 1.9.3
Finally, install MySQL (and the MySQL GUI tools)…
sudo apt-get install mysql-server libmysqlclient-dev libmysql-ruby mysql-admin