1. 安装 curl :
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
检查安装完成
rvm -v
2.安装ruby
rvm install 2.1.5
rvm 2.1.5 --default
切换gem源: gem source -r https://rubygems.org/ gem source -a https://ruby.taobao.org
3.安装rails
gem install rails
测试安装完成
rails -v
4.安装其它,安装nodejs, libmysqlclient-dev等,防止后面运行出错
sudo apt-get install nodejs
sudo apt-get install libmysqlclient-dev
原文地址:http://cpple.blog.51cto.com/6719977/1591194