Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: undefined method callback! #12

Closed
junaruga opened this issue Aug 12, 2016 · 6 comments
Closed

Error: undefined method callback! #12

junaruga opened this issue Aug 12, 2016 · 6 comments

Comments

@junaruga
Copy link
Contributor

Hi,

I got an error in the output of "rake test", though I could pass the test.
Could you tell me why this was happened?

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

$ bundle --version
Bundler version 1.12.5

$ git clone git@github.com:jonleighton/spring-watcher-listen.git

$ cd spring-watcher-listen

$ bundle install --path vendor/bundle

$ bundle list
Gems included by the bundle:
  * activesupport (5.0.0.1)
  * bundler (1.12.5)
  * concurrent-ruby (1.0.2)
  * ffi (1.9.14)
  * i18n (0.7.0)
  * listen (3.1.5)
  * minitest (5.9.0)
  * rake (11.2.2)
  * rb-fsevent (0.9.7)
  * rb-inotify (0.9.7)
  * ruby_dep (1.4.0)
  * spring (1.7.2 88bef7d)
  * spring-watcher-listen (2.0.0)
  * thread_safe (0.3.5)
  * tzinfo (1.2.2)

# Disable acceptance test because I did not install rails.
$ mv test/acceptance_test.rb test/acceptance_test.rb.disable

$ bundle exec rake >& build.log

$ cat build.log
...
./home/jaruga/git/spring-watcher-listen/lib/spring/watcher/listen.rb:39: warning: instance variable @listener not initialized
/home/jaruga/git/spring-watcher-listen/lib/spring/watcher/listen.rb:25: warning: instance variable @listener not initialized
E, [2016-08-12T17:55:26.023544 #32635] ERROR -- : run() in thread failed: undefined method `callback!' for nil:NilClass:\n /home/jaruga/git/spring-watcher-listen/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/event.rb:128:in `callback!'
...
12 runs, 19 assertions, 0 failures, 0 errors, 0 skips <= done with success.

Thank you.

@e2
Copy link
Contributor

e2 commented Aug 12, 2016

Likely problem:

I think your tests are simply too fast to let Listen initialized.

I don't think you need Listen for tests, so in your Gemfile you can probably move
spring-watcher-listen to the development group (so it isn't in the
test group);

Then you can make sure it isn't installed by running:

$ bundle install --path vendor/bundle --without development

and confirm Listen isn't included with:

$ bundle list

On Fri, Aug 12, 2016 at 09:07:50AM -0700, Jun Aruga wrote:

Hi,

I got an error in the output of "rake test", though I could pass the test.
Could you tell me why this was happened?

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

$ bundle --version
Bundler version 1.12.5

$ git clone git@github.com:jonleighton/spring-watcher-listen.git

$ cd spring-watcher-listen

$ bundle install --path vendor/bundle

$ bundle list
Gems included by the bundle:
  * activesupport (5.0.0.1)
  * bundler (1.12.5)
  * concurrent-ruby (1.0.2)
  * ffi (1.9.14)
  * i18n (0.7.0)
  * listen (3.1.5)
  * minitest (5.9.0)
  * rake (11.2.2)
  * rb-fsevent (0.9.7)
  * rb-inotify (0.9.7)
  * ruby_dep (1.4.0)
  * spring (1.7.2 88bef7d)
  * spring-watcher-listen (2.0.0)
  * thread_safe (0.3.5)
  * tzinfo (1.2.2)

# Disable acceptance test because I did not install rails.
$ mv test/acceptance_test.rb test/acceptance_test.rb.disable

$ bundle exec rake >& build.log

$ cat build.log
...
./home/jaruga/git/spring-watcher-listen/lib/spring/watcher/listen.rb:39: warning: instance variable @listener not initialized
/home/jaruga/git/spring-watcher-listen/lib/spring/watcher/listen.rb:25: warning: instance variable @listener not initialized
E, [2016-08-12T17:55:26.023544 #32635] ERROR -- : run() in thread failed: undefined method `callback!' for nil:NilClass:\n /home/jaruga/git/spring-watcher-listen/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/event.rb:128:in `callback!'
...
12 runs, 19 assertions, 0 failures, 0 errors, 0 skips <= done with success.

Thank you.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#12

@junaruga
Copy link
Contributor Author

@e2
Thank you for the replying. Actually I am a RPM package maintainer for your gem file on Fedora Project. Not a user.
For me, it is fine as all the test was passed though I could see the above error message.
Of course, I am happy that someone could fix the error.

@junaruga
Copy link
Contributor Author

junaruga commented Aug 15, 2016

I don't think you need Listen for tests, so in your Gemfile you can probably move
spring-watcher-listen to the development group (so it isn't in the
test group);

Then you can make sure it isn't installed by running:
$ bundle install --path vendor/bundle --without development
and confirm Listen isn't included with:

I could not understand your meaning.
I created Gemfile and I could see both spring-watcher-listen and listen were not installed in the bundle list without development.
Then?

$ cat Gemfile
source 'https://rubygems.org'

gem 'spring-watcher-listen', :group => :development

$ bundle install --path vendor/bundle --without development

$ bundle list
Gems included by the bundle:
  * bundler (1.12.5)

@e2
Copy link
Contributor

e2 commented Sep 29, 2016

It's fixed in: https://github.com/nex3/rb-inotify/blob/a3ff7cc/lib/rb-inotify/event.rb#L128

but not released yet: https://github.com/nex3/rb-inotify/pull/53/files

I might need to fork rb-notify :(

@junaruga
Copy link
Contributor Author

@e2
Sorry for late replying. OK!
rb-inotify latest version v0.9.7 still does not include the fix. So, I will wait it.
Thank you for the information.

@hbarrington
Copy link

This is still waiting to land?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants