安装ruby
sudo apt-get install ruby
$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
$ gem -v
1.8.23
参考https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng
添加ruby的ppa源
sudo add-apt-repository ppa:brightbox/ruby-ng
Next generation Ubuntu packages for Ruby 2.3, 2.2, 2.1, 2.0 1.9.3 and 1.8 EE.
See https://www.brightbox.com/docs/ruby/ubuntu/ for more details.
This PPA no longer includes Phusion Passenger packages, and NGINX packages with Passenger support. See https://launchpad.net/~brightbox/+archive/ubuntu/passenger-legacy
Discussion list here: https://groups.google.com/forum/#!forum/brightbox-ruby-ubuntu-packaging
https://www.brightbox.com
More info: https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmp6rrmbv29/secring.gpg' created
gpg: keyring `/tmp/tmp6rrmbv29/pubring.gpg' created
gpg: requesting key C3173AA6 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp6rrmbv29/trustdb.gpg: trustdb created
gpg: key C3173AA6: public key "Launchpad PPA for Brightbox" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
更新
sudo apt-get update
安装ruby2.3
sudo apt-get install ruby2.3
sudo apt-get install ruby2.3-dev
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux-gnu]
$ gem -v
2.5.1
更新源
sudo gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
sudo gem update --system -V
sudo gem update -V