如何使用rvm设置默认的ruby版本

时间:2013-01-22 16:40:08

标签: ruby macos

我已经使用

设置了我的默认ruby版本
rvm use 1.9.3 --default

打开新终端时,我可以看到rvm记得我的默认值,但是使用旧版本的ruby:

Last login: Tue Jan 22 17:36:20 on ttys000
➜  ~  rvm list default

Default Ruby (for new shells)

   ruby-1.9.3-p374 [ x86_64 ]

➜  ~  ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

➜  ~  rvm info

ruby-1.9.3-p374:

  system:
    uname:       "Darwin murzemac.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64"
    system:      "osx/10.8/x86_64"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)"
    zsh:         "/bin/zsh => zsh 4.3.11 (i386-apple-darwin12.0)"

  rvm:
    version:      "rvm 1.17.10 () by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "14 hours 46 minutes 38 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.8.7"
    date:         "2012-02-08"
    platform:     "universal-darwin12.0"
    patchlevel:   "2012-02-08 patchlevel 358"
    full_version: "ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]"

  homes:
    gem:          "/Users/murze/.rvm/gems/ruby-1.9.3-p374"
    ruby:         "/Users/murze/.rvm/rubies/ruby-1.9.3-p374"

  binaries:
    ruby:         "/usr/bin/ruby"
    irb:          "/usr/bin/irb"
    gem:          "/usr/bin/gem"
    rake:         "/usr/bin/rake"

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

打开新的终端窗口时如何自动激活1.9.3?

1 个答案:

答案 0 :(得分:0)

我的默认设置并不总是正确设置,所以我把.rvmrc放在我的终端打开的目录中(或者在我的终端可能打开的目录中),里面有rvm use default