1、更新apt-get源
# sudo apt-get install Python-software-properties
# sudo apt-add-repository ppa:brightBox/ruby-ng
# sudo apt-get update
2、安装ruby-dev
sudo apt-get install ruby2.3-dev
3、安装ruby
sudo apt-get install ruby2.3
4、安装rails
sudo gem install rails
5、/usr/local/bin/rails -v
Rails 5.0.1