質問

I’ve encountered this problem in a couple rails apps, and I haven’t been able to figure out what the common thread is or find any discussion of this specific problem.

Here’s what happens: guard does not run specs when files are changed. BUT, if I hit enter at its prompt, causing it to run all specs, it will immediately afterwards run specs for all changed files. It seems to be detecting the changes, as it should, but not acting on them until after I make it do something. This makes guard fairly useless to me.

The obvious answer is to try different things for monitoring file changes. I’ve read advice to try updating or downgrading the listen gem, for example. I’ve also tried running (bundle exec) guard with --force-polling and it behaves the same way. These haven’t made a difference in this app. And here’s the weird thing: I have a related rails app on the same computer, using the same versions of all the related gems, and an identical Guardfile, which works correctly! Here is that Guardfile (barely modified from some template), for reference.

I’m on OS X 10.8.3. The apps in question are currently using Rails 3.2.6, guard 1.2.1, rspec 2.12.0, and listen 0.6.0.

役に立ちましたか?

解決

Is there a specific reason for using outdated versions of both Guard and Listen?

I have a related rails app on the same computer, using the same versions of all the related gems, and an identical Guardfile, which works correctly!

Do those apps use different Ruby version? If one is on Ruby 1.8.7, did you add proper readline support?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top