1

I keep getting these errors on terminal whenever i run the following code.

rake test  or bundle exec rake test

/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- guard (LoadError)
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/guard-minitest-2.4.4/lib/minitest/guard_minitest_plugin.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:91:in `block in load_plugins'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `load_plugins'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:114:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:56:in `block in autorun'
drys
  • 13
  • 3
  • 1
    Show your test code that's causing this. – Ahmad Al-kheat Mar 23 '15 at 23:58
  • 1
    Looks like the `guard` gem is not installed; try running `bundle install`. – Prakash Murthy Mar 24 '15 at 00:04
  • i already did, but still tried it again. Still getting the same error. And how do i install the guard gem do i just add gem 'guard' to my gemfile.. – drys Mar 24 '15 at 00:12
  • @RailsOuter Here is the code they are still default nothing have been added require 'test_helper' class StaticPagesControllerTest < ActionController::TestCase test "should get home" do get :home assert_response :success end test "should get help" do get :help assert_response :success end end – drys Mar 24 '15 at 00:15
  • @PrakashMurthy.. Thanks man it worked, i added the gem file to the development group and it worked...but incase of other project which is best adding the guard gem to the development or test enviroment? – drys Mar 24 '15 at 00:24
  • @PrakashMurthy Please how do i mark as answered. This is actually my first question on this site. – drys Mar 24 '15 at 00:27

1 Answers1

1

Looks like guard is not installed/included in Gemfile. Include it in Gemfile if it is not already there. And run bundle install.

See http://railscasts.com/episodes/264-guard for how to use guard. https://github.com/guard/guard is also a good resource.

Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74