2

My default ruby is 2.0.0p384.

A ruby script has:

#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'

If the above header is changed to:

#!/usr/bin/ruby1.9.1

the script runs fine.

/var/lib/gems/2.0.0/gems/httparty-0.13.5 exists.

I can't understand why running the script with the 2.0.0 ruby gives:

/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in require': cannot load such file -- httparty (LoadError) from usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:inrequire' from ./check_pingdom:30:in `'

orde
  • 5,233
  • 6
  • 31
  • 33
smcracraft
  • 493
  • 6
  • 14
  • 2
    the gem is installed for 1.9.1 but not for 2.0.0. are you using rbevn or rvm or doing everything by hand? – Mircea Jun 02 '15 at 04:18
  • Hi Mircea. It is all manual. I want to have the least impact and footprint on the production system. – smcracraft Jun 02 '15 at 23:51
  • the gem is installed for 1.9.1 but not for 2.0.0. try running "gem env" to see where it is attempting to pick up the gems. – Mircea Jun 03 '15 at 04:32
  • gem env RubyGems Environment: - RUBYGEMS VERSION: 1.8.23 - RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux] - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1 - RUBY EXECUTABLE: /usr/bin/ruby1.9.1 : – smcracraft Jun 03 '15 at 20:29
  • I have the same problem, did you solve it? – Mina Wissa Jan 20 '16 at 13:01

0 Answers0