两个红宝石版本,需要整理

时间:2014-03-01 21:20:52

标签: ruby rubygems gem sudo

我的服务器上似乎安装了多个ruby / ruby​​gem。

每个人的宝石环境是:

root@weepingangel:~# gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.2.0
  - RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0
  - RUBY EXECUTABLE: /usr/local/rbenv/versions/2.1.0/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rbenv/versions/2.1.0/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0
     - /root/.gem/ruby/2.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org", "http://gems.github.com"]
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://gems.rubyforge.org
     - http://gems.github.com
  - SHELL PATH:
     - /usr/local/rbenv/versions/2.1.0/bin
     - /usr/local/rbenv/libexec
     - /usr/local/rbenv/shims
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games

root@weepingangel:~# sudo gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.11
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.9.1
     - /root/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org", "http://gems.github.com"]
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://gems.rubyforge.org
     - http://gems.github.com

有没有人知道如何清除这些内容,因为我只需要一个,我认为我看到了我的$ PATH,但它指的是错误的。

1 个答案:

答案 0 :(得分:0)

如果您使用rbenv,则可以在配置文件中运行此设置以设置默认的ruby环境。

$rbenv global 2.2.0

希望这有帮助。