ubuntu server 14.04安装新版本ruby

前端之家收集整理的这篇文章主要介绍了ubuntu server 14.04安装新版本ruby前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

安装ruby


  1. sudo apt-get install ruby


  1. $ ruby -v
  2. ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
  3.  
  4. $ gem -v
  5. 1.8.23



参考https://launchpad.net/~brightBox/+archive/ubuntu/ruby-ng

添加ruby的ppa源

  1. sudo add-apt-repository ppa:brightBox/ruby-ng

  1. Next generation Ubuntu packages for Ruby 2.3,2.2,2.1,2.0 1.9.3 and 1.8 EE.
  2.  
  3. See https://www.brightBox.com/docs/ruby/ubuntu/ for more details.
  4.  
  5. This PPA no longer includes Phusion Passenger packages,and Nginx packages with Passenger support. See https://launchpad.net/~brightBox/+archive/ubuntu/passenger-legacy
  6.  
  7. Discussion list here: https://groups.google.com/forum/#!forum/brightBox-ruby-ubuntu-packaging
  8.  
  9. https://www.brightBox.com
  10. More info: https://launchpad.net/~brightBox/+archive/ubuntu/ruby-ng
  11. Press [ENTER] to continue or ctrl-c to cancel adding it
  12.  
  13. gpg: keyring `/tmp/tmp6rrmbv29/secring.gpg' created
  14. gpg: keyring `/tmp/tmp6rrmbv29/pubring.gpg' created
  15. gpg: requesting key C3173AA6 from hkp server keyserver.ubuntu.com
  16. gpg: /tmp/tmp6rrmbv29/trustdb.gpg: trustdb created
  17. gpg: key C3173AA6: public key "Launchpad PPA for BrightBox" imported
  18. gpg: Total number processed: 1
  19. gpg: imported: 1 (RSA: 1)
  20. OK

更新

  1. sudo apt-get update

安装ruby2.3
  1. sudo apt-get install ruby2.3
  2. sudo apt-get install ruby2.3-dev

  1. $ ruby -v
  2. ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux-gnu]
  3.  
  4. $ gem -v
  5. 2.5.1


  1. sudo gem update --system -V

更新源
  1. sudo gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

  1. sudo gem update -V

猜你在找的Ubuntu相关文章