开发者

ruby version and gem's ruby version do not match

开发者 https://www.devze.com 2023-01-17 05:36 出处:网络
RubyGems is reporting a different ruby version than running ruby --version. Looking for suggestions on diagnosing and fixing this. OS is OS X 10.5.

RubyGems is reporting a different ruby version than running ruby --version. Looking for suggestions on diagnosing and fixing this. OS is OS X 10.5.

lando-macbook:rubygems-1.3.7 lando$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-9
  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/lkuhn/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

lando-macbook:rubygems-1.3.7 lando$ ruby --version
ruby 1.8开发者_开发知识库.7 (2010-08-16 patchlevel 302) [i686-darwin9]

lando-macbook:rubygems-1.3.7 lando$ which ruby
/opt/local/bin/ruby


The problem is that you have a ruby executable in /opt/local/bin that was probably installed by macports at some point. Either deleting this ruby executable or removing /opt/local/bin from your PATH variable should solve your problem. gems is telling you exactly where it expects to find ruby and its associated executables:

RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号