【问题标题】:switch to ruby version installed through RVM切换到通过 RVM 安装的 ruby​​ 版本
【发布时间】:2018-10-23 10:12:44
【问题描述】:

我的 macbook 是 OSX El Capitan。它预装了 Apple 通用 Ruby 2.0.0 版

现在,我想使用最新的 Ruby 2.3.0。我设法使用 rvm 来安装 Ruby 2.3.0。 rvm 完成安装 ruby​​ 2.3.0 后,我看到以下消息:

Ruby was built without documentation, to build it run: rvm docs generate-ri
/Users/John/.rvm/bin/rvm: line 66: shell_session_update: command not found
Creating alias default for ruby-2.3.0...

  * To start using RVM you need to run `source /Users/John/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.

我关注了这条消息,并运行命令

source /Users/John/.rvm/scripts/rvm

但是当我运行ruby -v 时,版本仍然是Apple 预装的Ruby 2.0.0。如何切换到我通过 rvm 安装的 ruby​​?

(在.rvm/rubies路径下我可以找到ruby-2.3.0)

【问题讨论】:

    标签: ruby macos rvm


    【解决方案1】:

    要切换到使用 2.3.0,请执行

    rvm use 2.3.0
    

    要将其设为默认,请执行

    rvm use --default 2.3.0
    

    【讨论】:

    • 你可以通过运行rvm list查看所有已安装的红宝石
    猜你喜欢
    • 1970-01-01
    • 2013-07-11
    • 1970-01-01
    • 2011-03-15
    • 2013-08-17
    • 1970-01-01
    • 2013-05-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多