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

Already on GitHub? Sign in to your account

Guard not running #195

Closed
madtrick opened this Issue Dec 19, 2011 · 11 comments

Comments

Projects
None yet
5 participants

Hi,

I've just installed the latest version (0.9.0) of the guard gem and it doesn't work on my system.

This is the output I get when I run it:

Please add rb-readline for proper Readline support.
Guard could not detect any of the supported notification libraries.
Guard is now watching at ''
/home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/watcher.rb:80:in `initialize': Permission denied - Failed to watch "/lost+found": read access to the given file is not permitted. (Errno::EACCES)
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:190:in `new'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:190:in `watch'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:199:in `watch'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:195:in `block in watch'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:192:in `each'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:192:in `watch'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/guard/listeners/linux.rb:58:in `watch'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/guard/listener.rb:95:in `start'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/guard/listeners/linux.rb:20:in `start'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/guard.rb:181:in `start'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/lib/guard/cli.rb:74:in `start'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.0/bin/guard:6:in `<top (required)>'
    from /home/madtrick/.rvm/gems/ruby-1.9.2-p290/bin/guard:19:in `load'

This are the related gems I have installed:

  • guard (0.9.0)
  • guard-shell (0.2.0)
  • rb-inotify (0.8.8)
  • rb-readline (0.4.2)

My Guardfile (in the same directory where I run guard) is this:

guard 'shell' do
  watch(%r{uploads/(.+)\.zip}) {|m| `rake deploy[#{m[1]}]`}
end
Contributor

netzpirat commented Dec 19, 2011

Are you running Guard with bundle exec ? I'm asking this because I see Please add rb-readline for proper Readline support. and you say that you've installed rb-readline.

The 0.9 Guard release comes with vendored gems for the the file system libraries and you can try to see what happens when you disable them with the -I (that's a capital i) option. Maybe @joshbuddy has some ideas.

matthee commented Dec 19, 2011

I'm experiencing similar problems. Guard doesn't seem to pick up any changes with or without rb-fsevent installed.

So i started off with a new rails-project for testing purposes. I added "gem 'rb-readline'", "gem 'guard'" and "gem 'guard-bundler'" to my fresh Gemfile (in this order).

After running "guard init" and "guard init bundler", the output of "bundle exec guard start" looks like this:

Guard could not detect any of the supported notification libraries.
Guard is now watching at ''
Bundle already up-to-date
> 

Guard doesn't detect a notification library, which is fine, because i haven't installed one. Notice that Guard says "Guard is now watching at ''" (two single quotes).

If I change my Gemfile, eg. adding rspec, but guard doesn't fire the bundle-command.

So i tried to run "bundle exec guard start -w ." in order to get around the empty working directory issue. Now Guard seems to pick up the correct directory, but the result stays the same.

any thoughts?

edit

My Gemversions:

  • rb-readline (0.4.2)
  • guard (0.9.0)
  • guard-bundler (0.1.3)

@netzpirat I'm running it without bundler. I mean, I installed all the gems directly with the gem command.

I've just installed the via Gemfile (vendoring the gems) and the problem persists. The only change is that this time rb-readline seems to be required.

My Gemfile:

# A sample Gemfile
source "http://rubygems.org"

# gem "rails"
gem "rb-readline"
gem "guard-shell"

My Gemfile.lock

[madtrick { guard-tests } ruby-1.9.2-p290 ]
>>cat Gemfile.lock 
GEM
  remote: http://rubygems.org/
  specs:
    ffi (1.0.11)
    guard (0.9.0)
      ffi (>= 0.5.0)
      thor (~> 0.14.6)
    guard-shell (0.2.0)
      guard (>= 0.2.0)
    rb-readline (0.4.2)
    thor (0.14.6)

PLATFORMS
  ruby

DEPENDENCIES
  guard-shell
  rb-readline

And the output of bundle exec guard

[madtrick { guard-tests } ruby-1.9.2-p290 ]
>>bundle exec guard
Guard could not detect any of the supported notification libraries.
Guard is now watching at ''
/home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/watcher.rb:80:in `initialize': Permission denied - Failed to watch "/lost+found": read access to the given file is not permitted. (Errno::EACCES)
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:190:in `new'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:190:in `watch'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:199:in `watch'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:195:in `block in watch'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:192:in `each'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/vendor/linux/lib/rb-inotify/notifier.rb:192:in `watch'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/guard/listeners/linux.rb:58:in `watch'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/guard/listener.rb:95:in `start'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/guard/listeners/linux.rb:20:in `start'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/guard.rb:181:in `start'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/lib/guard/cli.rb:74:in `start'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/gems/guard-0.9.0/bin/guard:6:in `<top (required)>'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/bin/guard:19:in `load'
    from /home/madtrick/guard-tests/vendor/ruby/1.9.1/bin/guard:19:in `<main>'

The curious thing is that if I run bundle exec guard list, guard complains that I have no guard in my Guardfile, but the shell guard has an * after it (which denotes it's present in the Guardfile)

My Guardfile:

[madtrick { guard-tests } ruby-1.9.2-p290 ]
>>cat Guardfile 
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

# Add files and commands to this file, like the example:
#   watch(%r{file/path}) { `command(s)` }
#
guard 'shell' do
  watch(/(.*).txt/) {|m| `tail #{m[0]}` }
end

The output of bundle exec guard list:

[madtrick { guard-tests } ruby-1.9.2-p290 ]
>>guard list
ERROR: No guards found in Guardfile, please add at least one.
Available guards:
   shell*
See also https://github.com/guard/guard/wiki/List-of-available-Guards
* denotes ones already in your Guardfile

Hope this helps

Contributor

netzpirat commented Dec 19, 2011

Thanks for all the information. I understand the problem now and you can expect a bugfix release soon. In the meanwhile, you can either explicit pass a directory to be watched or stick with guard 0.8.8.

Thanks, for your reply. I'll stay with 0.8.8 until the bugfix is released : )

@netzpirat netzpirat closed this in 9cb0fdd Dec 19, 2011

Contributor

netzpirat commented Dec 19, 2011

Guard 0.9.1 is out with a fix for the wrong working directory. Hope you all enjoy exploring all the other new bugs in Guard :P

pyrat commented Jan 6, 2012

Unfortunately I still experience this error with 0.9.1?

Owner

thibaudgg commented Jan 6, 2012

@pyrat have you try with Guard 0.10.0 ?

pyrat commented Jan 6, 2012

Yes and same error, 0.8.8 works fine. Will investigate further on Monday.

Owner

thibaudgg commented Jan 7, 2012

Can you give your Gemfile & Guardfile please (and be sure to launch guard with bundle exec guard)

pyrat commented Jan 9, 2012

False alarm! 0.10.0 works great, apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment