RVM打破了宝石,查找错误的Ruby版本

时间:2015-01-17 13:00:40

标签: ruby gem sass rvm compass-sass

我有ruby 2.2.0,我使用RVM进行需要2.0.0的项目

安装RVM后,我尝试在项目外使用sass或者指南针,并得到了这个:

$ compass watch
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 49 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /usr/bin/compass:22:in `<main>'

我尝试删除RVM并重新安装gem并且一切正常,但我需要它用于项目。

为什么要查看2.0文件夹?当我rvm info时,我得到ruby-2.2.0:


更新

$ which ruby
/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby


$ which compass
/usr/bin/compass


$rvm info

ruby-2.2.0:

  system:
    uname:       "Darwin ilyo-audyx.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64"
    system:      "osx/10.10/x86_64"
    bash:        "/bin/bash => GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)"
    zsh:         "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"

  rvm:
    version:      "rvm 1.26.9 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "4 days 7 hours 57 minutes 33 seconds ago"
    path:         "/Users/ilyo/.rvm"

  ruby:
    interpreter:  "ruby"
    version:      "2.2.0p0"
    date:         "2014-12-25"
    platform:     "x86_64-darwin14"
    patchlevel:   "2014-12-25 revision 49005"
    full_version: "ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]"

  homes:
    gem:          "/Users/ilyo/.rvm/gems/ruby-2.2.0"
    ruby:         "/Users/ilyo/.rvm/rubies/ruby-2.2.0"

  binaries:
    ruby:         "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby"
    irb:          "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/irb"
    gem:          "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/gem"
    rake:         "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/rake"

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

0 个答案:

没有答案