Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake aborted! cannot load such file -- yard

I have been trying to add a vagrant plugin (https://github.com/schisamo/vagrant-omnibus) from source. I downloaded it, did "bundle install", which went smooth. But when I did "rake install", it showed me the following error:

rake aborted!
cannot load such file -- yard

Here is the full error log with trace:

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>'

Here is the gem list:

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

Any idea what could be causing this error?

like image 264
Pensu Avatar asked Dec 18 '13 07:12

Pensu


2 Answers

You should use bundle exec to "run the command in context of the bundle":

bundle exec rake install

If that does not work, maybe it’s a bug and yard is not even in the Gemfile. A temporary workaround would be to add this line manually to the Gemfile:

gem 'yard'
like image 74
Patrick Oscity Avatar answered Sep 27 '22 23:09

Patrick Oscity


Try to set right environment for you

for example

Rails_ENV=test

like image 34
Dominik Avatar answered Sep 27 '22 23:09

Dominik