guard / rb-inotify

A thorough inotify wrapper for Ruby using FFI.
MIT License
312 stars 64 forks source link

On Rails cache files, No such file or directory - Failed to watch #13

Closed shanlalit closed 13 years ago

shanlalit commented 13 years ago

Gaurd crashes, when rails cache files are created. It works fine if I configure Test environment cache_store to memcached instead for file store which is default.

REE 1.8.7 Rails 3.0.7

/home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/watcher.rb:80:in `initialize': 
No such file or directory - Failed to watch "/home/shanlalit/work/x-project/tmp/cache/User.all.120110621-4065-yf1f9x-0.lock" (Errno::ENOENT)
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:182:in `new'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:182:in `watch'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:190:in `watch'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:193:in `watch'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/watcher.rb:41:in `[]'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/watcher.rb:41:in `callback!'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/event.rb:128:in `callback!'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:220:in `process'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:220:in `each'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/rb-inotify-0.8.5/lib/rb-inotify/notifier.rb:220:in `process'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/guard-0.4.2/lib/guard/listeners/linux.rb:65:in `watch_change'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/guard-0.4.2/lib/guard/listeners/linux.rb:16:in `start'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/guard-0.4.2/lib/guard.rb:39:in `start'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/guard-0.4.2/lib/guard/cli.rb:15:in `start'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/guard-0.4.2/bin/guard:6
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/bin/guard:19:in `load'
    from /home/shanlalit/.rvm/gems/ree-1.8.7-2011.03@rails3/bin/guard:19
suzi2000 commented 13 years ago

Same problem here, im using 1.9.2 and rails 3.1.rc5, spork and sqlite with :memory: mode

/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rb-inotify-0.8.5/lib/rb-inotify/watcher.rb:80:in `initialize': 
No such file or directory - Failed to watch "/home/user/myapp/tmp/cache/assets/
sprockets%2Fapp%2Fassets%2Fstylesheets%2Fapplication.css.
scss20110730-17145-119h60u.lock" (Errno::ENOENT)

i also tried removing all scss and css files from guard 'livereload' do but its still crashing

suzi2000 commented 13 years ago

i updated my bundle and i am using rb-inotify (0.8.6 f7879c5) from 'https://github.com/nex3/rb-inotify.git' it seems to have fixed the issue, but its important to run bundle exec guard instead of just guard. i guess that it only updated my project gem and not the global ones