Ruby in `gem_original_require': no such file to load -- CloudyScripts (LoadError)
On Ubuntu and Ruby 1.8.7, I installed CloudyScripts via:
gem install gem install CloudyScripts
When I try to execute this:
require 'rubygems'
require 'CloudyScripts'
I get the following error:
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- CloudyScripts (LoadError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/ubuntu/copyami.rb:3
$ gem list
*** LOCAL GEMS ***
amazon-ec2 (0.9.17)
CloudyScripts (1.9.40)
net-scp (1.0.4)
net-ssh (2.2.1)
xml-simple (1.1.0)
The gem is installed in /var/lib/gems/1.8/gems, the contents of which are
drwxr-xr-x 6 root root 4096 2011-08-31 17:39 amazon-ec2-0.9.17
drwxr-xr-x 3 root root 4096 2011-08-31 18:39 CloudyScripts-1.9.40
drwxr-xr-x 4 root root 4096 2011-08-31 17:39 net-scp-1.0.4
drwxr-xr-x 5 root root 4096 2011-08-31 17:39 net-ssh-2.2.1
drwxr-xr-x 3 root root 4096 2011-08-31 17:39 xml-simple-1.1.0
And $LOAD_PATH is /usr/local/lib/site_ruby/1.8 /usr/local/lib/site_ruby/1.8/x86_64-linux /usr/local/lib/site_ruby /usr/lib/ruby/vendor_开发者_如何学运维ruby/1.8 /usr/lib/ruby/vendor_ruby/1.8/x86_64-linux /usr/lib/ruby/vendor_ruby /usr/lib/ruby/1.8 /usr/lib/ruby/1.8/x86_64-linux .
Why am I getting the load error?
You should try
gem "CloudyScripts"
require "cloudyscripts"
Only the gem name is camelcased, but not the ruby files in it.
I had a similar problem when I was trying to run the rng(release notes generator command). The error is shown below.
/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- thor (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from ./rng:6:in `'
After lot of searching around I found the above post helpful. I just had to run C:\mydirectory>gem install thor
The rng command works perfectly now
精彩评论