Guard: LoadError: cannot load such file

Created on 28 Jan 2015  ·  16Comments  ·  Source: guard/guard

Hi all,

I'm not really sure if this is a proper issue, but after upgrading ruby in my rails project to 2.1.4, I no longer am able to run the project through rails s, rails c, or any rake tasks. Everything worked fine in 2.1.2.

Here's the error I keep getting:

$ rake db:drop db:create db:migrate
rake aborted!
LoadError: cannot load such file -- guard/guard
/Users/jonathan/code/sirius/config/application.rb:14:in `<top (required)>'
/Users/jonathan/code/sirius/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- guard-spring
/Users/jonathan/code/sirius/config/application.rb:14:in `<top (required)>'
/Users/jonathan/code/sirius/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

I'm on OSX, ruby installed via rbenv. I'm running Gemfile.lock says guard is at 2.11.1. Any help on this issue appreciated.

Most helpful comment

I've just updated the guard gems versions, and it worked magic

All 16 comments

1) Just remove guard-spring from your Gemfile and Guardfile.
2) Then upgrade guard-rspec (run bundle update guard-rspec)
3) Setup guard-rspec to use spring (see this: https://github.com/guard/guard-rspec#options)

Explanation:
guard-spring is not updated to work with newer versions of Guard, but it's not even necessary anymore, since guard-rspec supports spring.

Thanks! Everything works again after that.

thanks, it worked

don't works. i don't have guard-spring in Gemfile and Guardfile. steps 2, 3 don't help

@ElminDmitry - your problem may be different. If you have "guard/guard" in the message, you may be using some outdated Guard plugin.

Try "bundle exec rake (...)" instead - it may help to find the cause.

If you can, open a new issue, paste your Gemfile and Gemfile.lock (or at least bundle show output).

Or, you can try running guard -d - any errors there may help as well.

Problem appears after adding and installing gem 'guard-spork' gem 'childprocess'

Guard-spork is outdated as far as I remember, so remove it and/or use guard-zeus or spring.

Thanks for help

The one that was outdated for me was guard-resque.

I had a similar issue with a legacy codebase. Here are the versions that worked for me to overcome the missing guard/guard requirement.

group :development do
  gem 'guard-rails', '0.7.2', require: false
  gem 'guard-rspec', '3.1.0', require: false
  gem 'guard-rubocop', '1.2.0', require: false
  gem 'guard-spork', '2.1.0', require: false
end

Same here today. I had to pin rspec to ' ~> 3.4.0' to solve it, after bundle update gave me rspec 3.5 beta3.

I've just updated the guard gems versions, and it worked magic

anyone using guard-konacha, it seems to be no longer working for anyone also getting

LoadError: cannot load such file -- guard/guard

@tastycakeman guard-konacha gem relies on Guard version 1. Change your gemfile to gem 'guard-konacha', github: 'lbeder/guard-konacha' which has an updated gemspec to support a newer version of Guard.

When running rake db:create I am facing following error:

`rake aborted!

LoadError: cannot load such file -- guard/guard
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:inblock in require'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency' /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:inrequire'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/guard-migrate-1.0.4/lib/guard/migrate.rb:2:in <top (required)>' /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:95:inrequire'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:95:in rescue in block in require' /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:72:inblock in require'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:65:in each' /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler/runtime.rb:65:inrequire'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/bundler-1.16.0/lib/bundler.rb:114:in require' /Users/macbookpro06/Desktop/projects/pradeep/ashley/oohmpv2/config/application.rb:7:in /Users/macbookpro06/Desktop/projects/pradeep/ashley/oohmpv2/Rakefile:5:in require' /Users/macbookpro06/Desktop/projects/pradeep/ashley/oohmpv2/Rakefile:5:in /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/gems/rake-12.3.0/exe/rake:27:in <top (required)>' /Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/bin/ruby_executable_hooks:15:ineval'
/Users/macbookpro06/.rvm/gems/ruby-2.0.0-p247@oohmp-v2/bin/ruby_executable_hooks:15:in <main>' (See full trace by running task with --trace)

I am new to ruby, but now its been 3days, failing to make it work on windows. my error:
rake db:create
rake aborted!
LoadError: cannot load such file -- /mnt/c/code/myapp/config/application
/mnt/c/code/myapp/rakefile:4:in require_relative' /mnt/c/code/myapp/rakefile:4:in (See full trace by running task with --trace)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mockdeep picture mockdeep  ·  23Comments

bgentry picture bgentry  ·  10Comments

greyblake picture greyblake  ·  18Comments

Odaeus picture Odaeus  ·  21Comments

tomrossi7 picture tomrossi7  ·  6Comments