1

需要安装的 gem 不可见。

用我安装了几次的 hpricot 进行测试:

irb(main):001:0> require "rubygems"
=> false
irb(main):002:0> require "hpricot"
LoadError: no such file to load -- hpricot
        from (irb):2:in `require'
        from (irb):2
        from /usr/bin/irb:12:in `<main>'
irb(main):003:0> 

RubyGems 环境:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-07-02 patchlevel -1) [i486-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.9.2
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.2
  - EXECUTABLE DIRECTORY: /var/lib/gems/1.9.2/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /var/lib/gems/1.9.2
     - /root/.gem/ruby/1.9.2
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

我安装了多个版本的 ruby​​(回溯 5r2)

targeex@bt:/home/targeex/Stage/Application_Wissam# update-alternatives --config ruby
There are 2 choices for the alternative ruby (providing /usr/bin/ruby).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/ruby1.8     600       auto mode
  1            /usr/bin/ruby1.8     600       manual mode
* 2            /usr/bin/ruby1.9.2   400       manual mode

Press enter to keep the current choice[*], or type selection number: 2

我能做些什么?

4

1 回答 1

2

看起来您可能没有在正确的红宝石中安装 gem。如果可以的话,切换到使用 RVM (https://rvm.io/) 它会治愈你的困扰。

于 2012-06-14T12:07:34.050 回答