1. 安装git
sudo apt-get install build-essential git-core curl
2. 安装rvm
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
3. 配置
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
. ~/.bashrc
4. 安装依赖包
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison subversion
在11.10,两个包名发生了变化 'libxslt1-dev' instead of 'libxslt-dev', 'libncurses5-dev' instead of 'ncurses-dev'
5. 安装ruby
$ rvm pkg install zlib
$ rvm install 1.9.2
$ rvm use 1.9.2
$ rvm --default use 1.9.2
===================================
https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm