问题
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:in
require' from ./check_pingdom:30:in `'
来源:https://stackoverflow.com/questions/30584455/in-require-cannot-load-such-file-httparty-loaderror