Skip to content

No such file to load -- guard/notifier #11

Closed
jerodsanto opened this Issue Jun 22, 2011 · 24 comments

7 participants

@jerodsanto

I'm running guard 0.4.2 and guard-test 0.3.0 on ree-1.8.7-2011.03 and Rails 2.3.3.

I'm just using the default Rails rules as generated from guard init test, but when I run guard I get the LoadError as described in the title. Here is the entire stack trace:

/Users/jerod/.rvm/gems/ree-1.8.7-2011.03@donations/gems/guard-test-0.3.0/lib/guard/test/notifier.rb:2:in `require': no such file to load -- guard/notifier (LoadError)
from /Users/jerod/.rvm/gems/ree-1.8.7-2011.03@donations/gems/guard-test-0.3.0/lib/guard/test/notifier.rb:2
        from /Users/jerod/.rvm/gems/ree-1.8.7-2011.03@donations/gems/guard-test-0.3.0/lib/guard/test/runners/default_guard_test_runner.rb:6:in `require'
        from /Users/jerod/.rvm/gems/ree-1.8.7-2011.03@donations/gems/guard-test-0.3.0/lib/guard/test/runners/default_guard_test_runner.rb:6

What is strange is that if I fire up an irb session and run require "guard/notifier" it runs just fine.

Any help would be much appreciated.

@rymai
Guard member
rymai commented Jun 22, 2011

Can you show me your Gemfile please?

@jerodsanto

This is a Rails 2.3.3 app and it does not use Bundler. Does guard or guard-test require Bundler to function properly?

@rymai rymai pushed a commit that closed this issue Jun 22, 2011
Rémy Coutable Try to fix #11 by requiring guard 4930d21
@rymai rymai closed this in 4930d21 Jun 22, 2011
@rymai rymai reopened this Jun 22, 2011
@rymai
Guard member
rymai commented Jun 22, 2011

Sorry, didn't mean to close it. :)

Can you try from the master and let me know how it goes?

Thanks!

@jerodsanto

No dice. Maybe it just won't play nice without Bundler?

@rymai
Guard member
rymai commented Jun 23, 2011

Maybe... but we have to know why if that's the case! :)

Unfortunately, I won't have time until next week to look into this, maybe it's to to use Bundler then? ;)

@rymai
Guard member
rymai commented Sep 29, 2011

Is the issue still present?

@lagsalot

I just fired up guard on a old project and I am getting the same issue.

Installed Gems: https://gist.github.com/32ad801f973320d868ec

rvm env: https://gist.github.com/a76eaef51eca00b2f5bd

backtrace: https://gist.github.com/bff7c5cee433d6b1e618

@regularfry

Still got the same issue here:

/home/zander/.rvm/gems/ruby-1.8.7-p302/gems/guard-test-0.4.0/lib/guard/test/guard_test_runner.rb:5:in `require': no such file to load -- guard/test/notifier (LoadError)
    from /home/zander/.rvm/gems/ruby-1.8.7-p302/gems/guard-test-0.4.0/lib/guard/test/guard_test_runner.rb:5

This is a non-rails app on MRI 1.8.7-p302. Gemfile is:

source "http://rubygems.org"
gem "highline"

platforms :ruby do
  gem "json_pure"
end


platforms :jruby do
  gem "json"
end

group :test do
  gem "mocha"
  gem "webmock"
end

Guardfile is:

guard :test do #, :rvm => %w{bigv ruby-1.8.6-p368 ruby-1.9.2-p290} do
  watch(%r{^lib/(.+)/([^/]+)\.rb$})     { |m| "test/#{m[1]}/test_#{m[2]}.rb" }
end

# vim: set filetype=ruby:
@jlecour
jlecour commented Oct 6, 2011

Hi, I have the same issue.

It's been working for a while, then, after a few weeks without runing the test suite, it stopped working.

manually requiring "guard/notifier" doesn't work, because it then complains about missing "guard/test/notifier"

@rymai
Guard member
rymai commented Oct 6, 2011

Thanks guys!

@lagsalot: Could it be possible to see your Guardfile?
@regularfry: Why don't you have guard-test in your Gemfile, is there a reason?
@jlecour: What Ruby are you using?

Thanks in advance.

@jlecour
jlecour commented Oct 6, 2011

My bad, I was missing some lines in my gemspec (the project is a gem).

@lagsalot
lagsalot commented Oct 7, 2011

Nothing fancy in the Guardfile I believe.

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard :test do
  watch(%r{^lib/(.+)\.rb$})     { |m| "test/#{m[1]}_test.rb" }
  watch(%r{^test/.+_test\.rb$})
  watch('test/test_helper.rb')  { "test" }

  # Rails example
  watch(%r{^app/models/(.+)\.rb$})                   { |m| "test/unit/#{m[1]}_test.rb" }
  watch(%r{^app/controllers/(.+)\.rb$})              { |m| "test/functional/#{m[1]}_test.rb" }
  watch(%r{^app/views/.+\.rb$})                      { "test/integration" }
  watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] }
end
@regularfry

guard-test isn't in my Gemfile because it's my dependency, not the project's - I'm not foisting the way I'm working on it on my co-workers. Yet :-)

@krisleech

I have the same issue.

Rails 2.3.14
Ruby-1.8.7-p72

I could be wrong but in lib/guard/test.rb it does seem require 'guard/test/notifier' should be require 'lib/guard/test/notifier' based on the load path (gem root, not lib root) which is added.

However I then get an error in notifier.rb for require 'guard' which I would assume should already be in the load path by then.

@krisleech

In fact chaing the load path at the top of lib/guard/test/guard_test_runner.rb to $:.push File.expand_path('../../', File.dirname(__FILE__)) has the same effect - solves this error, but introduces another.

@rymai rymai pushed a commit that closed this issue Nov 3, 2011
Rémy Coutable Fix #11 bf1ec94
@rymai rymai closed this in bf1ec94 Nov 3, 2011
@rymai
Guard member
rymai commented Nov 3, 2011

Hey guys, I've just released 0.4.1, the issue should be fixed! Could you confirm? Thanks for all!

@krisleech

Thanks, It seems to have fixed the original require issue, but I get a further require related error:

/Users/****/.rvm/gems/ruby-1.8.7-p72@jsg/gems/guard-test-0.4.1/lib/guard/test/notifier.rb:2:inrequire': no such file to load -- guard (LoadError)`

I'm using guard 0.8.8 and guard-test 0.4.1 and both are in environment/development.rb.

@rymai
Guard member
rymai commented Nov 4, 2011

I see, I should require rubygems either in the test-unit command line that's run or inside guard/test/notifier.rb. I'll try that later! Thanks!

@rymai rymai reopened this Nov 4, 2011
@rymai
Guard member
rymai commented Nov 5, 2011

Hi,

could you give me more info on your Gemfile, Guardfile and how you launch guard (with bundle exec or not)?

Thanks!

@rymai
Guard member
rymai commented Nov 5, 2011

Anyway, I've tried a fix here, could you give the dev branch a try and let me know? Thanks in advance!

@rymai
Guard member
rymai commented Nov 19, 2011

Does 0.4.2 (just released) fixes the issue?

@rymai
Guard member
rymai commented Dec 12, 2011

Any news?

@gnoireaux

Had this issue on 0.4.0, updated to 0.4.3: had #20

Thanks for fixing #11

@rymai
Guard member
rymai commented Jan 11, 2012

Aha, ok that's cool if #11 is fixed then! :)

@rymai rymai closed this Jan 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.