【问题标题】:ruby gem not found although it is installed (Ubuntu 14)尽管已安装 ruby​​ gem,但未找到它(Ubuntu 14)
【发布时间】:2014-11-15 17:14:59
【问题描述】:

我知道以前有人问过这个问题,但我无法用现有的建议来解决它。

我的gem环境如下:

gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.3 (2014-10-27 patchlevel 550) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.9.1
     - /home/egge/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

我安装了我的 gem:

gem list --local | grep active
activesupport (4.1.7)
activesupport-inflector (0.1.0)

但是当我运行 ruby​​ 时,却找不到:

/usr/bin/ruby1.9.1 -e 'require "active_support/inflector"'
-e:1:in `require': cannot load such file -- active_support/inflector (LoadError)
from -e:1:in `<main>'

我不知道为什么这个设置不起作用。

【问题讨论】:

    标签: ruby rubygems ubuntu-14.04 activesupport


    【解决方案1】:

    我找到了解决方法。我不确定我的问题的原因是什么,但显然 Ruby 1.9.2+ 有一些变化。以下工作正常:

    /usr/bin/ruby1.9.1 --disable-gems -e 'require "rubygems"; require "active_support/inflector"'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-24
      • 2020-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多