如何使用RVM安装Ruby 2.2.2

时间:2017-03-13 22:08:52

标签: ruby install rvm

我运行rvm -v并返回rvm 1.29.1所以我运行rvm install 2.2.2来升级Ruby版本。

显示:

ruby-2.2.2 - #removing rubies/ruby-2.2.2..
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.2.tar.bz2
ruby-2.2.2 - #configure
ruby-2.2.2 - #download
ruby-2.2.2 - #validate archive
ruby-2.2.2 - #extract
ruby-2.2.2 - #validate binary
ruby-2.2.2 - #setup
ruby-2.2.2 - #gemset created /usr/local/rvm/gems/ruby-2.2.2@global
ruby-2.2.2 - #importing gemset /usr/local/rvm/gemsets/global.gems...............
ruby-2.2.2 - #generating global wrappers........
ruby-2.2.2 - #gemset created /usr/local/rvm/gems/ruby-2.2.2
ruby-2.2.2 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.2 - #generating default wrappers........
Making gemset ruby-2.2.2 pristine..............................................-
Making gemset ruby-2.2.2@global pristine.......................................|

我再次运行rvm -v并显示rvm 1.29.1。这意味着RVM没有安装或无法正常工作。有什么建议吗?

3 个答案:

答案 0 :(得分:6)

你试过了吗?

$ rvm use 2.2.2

来自:https://rvm.io/rvm/basics

答案 1 :(得分:5)

RVM和ruby是两回事。

您正在运行RVM -v以获取应该执行的ruby版本

ruby -v 

使用rvm

回答要安装的问题
rvm install <version>
rvm use <version>
ruby -v

答案 2 :(得分:0)

我是在CentOS 6.5上做到的:

  1. 使用gpg更新密钥(请参阅此处https://rvm.io/rvm/install
  2. 安装rvm:curl -sSL https://get.rvm.io | bash -s stable
  3. 安装ruby:rvm install ruby-2.2.2