Ruby中的'gem_original_require':没有要加载的文件 - CloudyScripts(LoadError)

时间:2011-08-31 19:24:54

标签: ruby gem

在Ubuntu和Ruby 1.8.7上,我通过以下方式安装了CloudyScripts:

gem install gem install CloudyScripts

当我尝试执行此操作时:

require 'rubygems'
require 'CloudyScripts'

我收到以下错误:

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

gem安装在/var/lib/gems/1.8/gems中,其内容为

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

$ LOAD_PATH是     /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中/红宝石/ vendor_ruby     /usr/lib/ruby/1.8     /usr/lib/ruby/1.8/x86_64-linux     

为什么我收到加载错误?

2 个答案:

答案 0 :(得分:6)

你应该试试

gem "CloudyScripts"
require "cloudyscripts"

只有宝石名称,而不是ruby files

答案 1 :(得分:0)

当我尝试运行rng(发行说明生成器命令)时,我遇到了类似的问题。错误如下所示。

/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'         来自./rng:6:在''

经过大量的搜索,我发现以上帖子很有帮助。我只是跑了 C:\ mydirectory> gem install thor

rng命令现在可以正常工作