source : http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
1. git curl:
sudo apt-get install build-essential git-core curl
2. rvm:
curl -L get.rvm.io | bash -s stable
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
. ~/.bashrc
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev
sudo apt-get install curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3
sudo apt-get install libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
subversion
3. ruby:
rvm install 1.9.3
rvm use 1.9.3
rvm --default use 1.9.3
4. rails:
gem install rails -v 3.2.3
5. mysql:
sudo apt-get install libmysqlclient-dev