How to fix Guard events not firing on OS X

I just lost an entire afternoon's worth of work because I just could NOT get Guard to make Spork reload when the spec_helper file was changed. I thought my Guardfile was wrong, I even spent 2+ hours digging around the Guard code itself. It turns out that the OS X notification system used by default by Guard, rb-fsevent, randomly decides to have a mental breakdown on your system. There's an entire Github Issue thread spanning the duration of 10+ minutes describing the headaches caused by rb-fsevent not sending the events.

The Workaround

The workaround is to tell Guard to not look for rb-fsevent, but to instead use polling. To do so, append the --no-vendor option when starting up your Guard server.
$ bundle exec guard --no-vendor
Polling is a more expensive operation, but hey, at least it works. February 20, 2012
About the Author:

Joseph is the lead developer of Vert Studios Follow Joseph on Twitter: @Joe_Query
Subscribe to the blog: RSS
Visit Joseph's site: