ruby gem not found although it is installed (Ubuntu 14)

403 views Asked by At

I know this question has been asked before, yet I've not been able to remedy it with the existing advice.

My gem environment is as follows:

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/

I installed the my gem:

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

But when I run ruby, it can't find it:

/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>'

I am at a loss as to why this setup isn't working.

1

There are 1 answers

0
brianegge On

I found a workaround. I'm not sure what the cause of my issue is, but apparently there is some change with Ruby 1.9.2+. The following works fine:

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