rvm info有不同版本的ruby

时间:2014-03-14 07:03:59

标签: ruby rvm

在运行.zshrc后安装rvm并修改我的rvm info文件后,我得到了一个不同的版本,当我输入ruby -v时,当我尝试安装gem时,我得到一堆错误相关系统ruby

rvm info输出:

$ rvm info

ruby-2.1.1:

  system:
    uname:       "Darwin Joshs-MacBook-Pro.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64"
    system:      "osx/10.9/x86_64"
    bash:        "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
    zsh:         "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"

  rvm:
    version:      "rvm 1.25.20 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "3 hours 4 minutes 13 seconds ago"
    path:         "/Users/joshburns/.rvm"

  ruby:
    interpreter:  "ruby"
    version:      "2.0.0p247"
    date:         "2013-06-27"
    platform:     "universal.x86_64-darwin13"
    patchlevel:   "2013-06-27 revision 41674"
    full_version: "ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]"

  homes:
ZSH=$HOME/.oh-my-zsh
    gem:          "/Users/joshburns/.rvm/gems/ruby-2.1.1"
    ruby:         "/Users/joshburns/.rvm/rubies/ruby-2.1.1"

  binaries:
    ruby:         "/usr/bin/ruby"
    irb:          "/usr/bin/irb"
    gem:          "/usr/bin/gem"
    rake:         "/Users/joshburns/.rvm/gems/ruby-2.1.1/bin/rake"

  environment:
    PATH:         "/Users/joshburns/.rvm/gems/ruby-2.1.1/bin:/Users/joshburns/.rvm/gems/ruby-2.1.1@global/bin:/Users/joshburns/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/joshburns/bin:/Users/joshburns/.rvm/bin"
    GEM_HOME:     "/Users/joshburns/.rvm/gems/ruby-2.1.1"
    GEM_PATH:     "/Users/joshburns/.rvm/gems/ruby-2.1.1:/Users/joshburns/.rvm/gems/ruby-2.1.1@global"
    MY_RUBY_HOME: "/Users/joshburns/.rvm/rubies/ruby-2.1.1"
    IRBRC:        "/Users/joshburns/.rvm/rubies/ruby-2.1.1/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

ruby -v输出:

ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

1 个答案:

答案 0 :(得分:0)

我想我遇到了类似的问题,但在这里找到了解决方案: http://www.intelligentbee.com/blog/2013/09/17/setup-a-simple-ruby-2-on-rails-4-environment-with-vagrant-and-virtual-box/

找点:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

rvm use ruby-2.0.0-p247 (replace with your ruby version)