耙子流产了!不能加载这样的文件 - 码

时间:2013-12-18 07:05:52

标签: ruby rubygems vagrant

我一直在尝试从源代码添加一个vagrant插件(https://github.com/schisamo/vagrant-omnibus)。我下载了它,做了“捆绑安装”,顺利进行。但是当我做“rake install”时,它向我显示了以下错误:

rake aborted!
cannot load such file -- yard

以下是带有跟踪的完整错误日志:

rake aborted!
cannot load such file -- yard
/root/chef-solo-example/vagrant-omnibus-master/Rakefile:5:in `require'
/root/chef-solo-example/vagrant-omnibus-master/Rakefile:5:in `<top (required)>'
/usr/share/gems/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/usr/share/gems/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/share/gems/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/usr/share/gems/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/bin/rake:23:in `load'
/bin/rake:23:in `<main>'

这是宝石列表:

*** LOCAL GEMS ***

archive-tar-minitar (0.5.2)
ast (1.1.0)
bigdecimal (1.2.0)
bundler (1.3.1)
chef (11.8.2)
chef-zero (1.7.2)
coderay (1.1.0)
diff-lcs (1.2.5)
erubis (2.7.0)
hashie (2.0.5)
highline (1.6.20)
io-console (0.4.2)
ipaddress (0.8.0)
json (1.7.7)
knife-solo (0.4.1)
librarian (0.1.0)
librarian-chef (0.0.2)
method_source (0.8.2)
mime-types (1.16)
mixlib-authentication (1.3.0)
mixlib-cli (1.4.0)
mixlib-config (2.1.0)
mixlib-log (1.6.0)
mixlib-shellout (1.3.0)
moneta (0.7.20, 0.7.0, 0.6.0)
net-http-persistent (2.8)
net-ssh (2.7.0)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.2.0, 1.1)
ohai (6.20.0)
parser (2.0.0)
powerpack (0.0.9, 0.0.6)
pry (0.9.12.4)
psych (2.0.0)
puma (1.6.0)
rack (1.5.2)
rainbow (1.1.4)
rake (10.0.4)
rake-compiler (0.8.3)
rdoc (4.0.1)
rest-client (1.6.7)
rspec (2.14.1)
rspec-core (2.14.0)
rspec-expectations (2.14.0)
rspec-mocks (2.14.0)
rubocop (0.15.0)
slop (3.4.7)
systemu (2.6.0, 2.5.2)
thor (0.17.0)
yajl-ruby (1.1.0)
yard (0.8.7.3)

知道可能导致此错误的原因是什么?

3 个答案:

答案 0 :(得分:4)

您应该使用bundle exec to "run the command in context of the bundle"

bundle exec rake install

如果这不起作用,也许这是一个错误而且码数甚至不在Gemfile。临时解决方法是手动将此行添加到Gemfile

gem 'yard'

答案 1 :(得分:0)

尝试为您设置合适的环境

例如

  

Rails_ENV = test

答案 2 :(得分:-3)

以下步骤解决了我的问题。它也可能对你有帮助。

1:尝试卸载Ruby 2:重新安装时,请检查要求关联.rb文件和可执行文件的第2和第3个复选框。
3:同时检查环境变量中的Path是否具有所有正确的路径。