Closed leebrooks0 closed 11 years ago
Could you paste your Guardfile? Thanks.
# A sample Guardfile
# More info at https://github.com/guard/guard#readme \
ignore %r{^.idea}
guard 'annotate', notify: false, routes: true, tests: true, show_indexes: true do
watch( 'db/schema.rb' )
# Uncomment the following line if you also want to run annotate anytime
# a model file changes
#watch( 'app/models/**/*.rb' )
# Uncomment the following line if you are running routes annotation
# with the ":routes => true" option
watch( 'config/routes.rb' )
end
guard 'coffeescript', :input => 'app/assets/javascripts',:noop => true, :hide_success => true
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/presenters/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" }
end
guard 'minitest' do
# with Minitest::Unit
watch(%r|^test/(.*)\/?test_(.*)\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r|^test/test_helper\.rb|) { "test" }
# with Minitest::Spec
# watch(%r|^spec/(.*)_spec\.rb|)
# watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
# watch(%r|^spec/spec_helper\.rb|) { "spec" }
# Rails 3.2
# watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/controllers/#{m[1]}_test.rb" }
# watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
# watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
# Rails
# watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
# watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
# watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
end
#guard 'rails',force_run: true do
# watch('Gemfile.lock')
# watch(%r{^(config|lib)/.*})
#end
guard 'sass', :input => 'app/assets/stylesheets', :noop => true, :hide_success => true
I think it is a bug of Guard-annotate, I test the Guardfile like this:
guard 'annotate', notify: false, routes: true, tests: true, show_indexes: true do
watch( 'db/schema.rb' )
# Uncomment the following line if you also want to run annotate anytime
# a model file changes
#watch( 'app/models/**/*.rb' )
# Uncomment the following line if you are running routes annotation
# with the ":routes => true" option
watch( 'config/routes.rb' )
end
When I saving the file db/schema.rb
, annotate will keep restarting to die.
And output like this:
09:05:31 - INFO - Running annotate
Nothing annotated.
Route file annotated.
09:05:38 - INFO - Running annotate
Nothing annotated.
Route file annotated.
09:05:46 - INFO - Running annotate
Nothing annotated.
Route file annotated.
09:05:53 - INFO - Running annotate
Nothing annotated.
Route file annotated.
09:06:01 - INFO - Running annotate
Nothing annotated.
My version of Guard-annotate is the latest:
guard-annotate (1.1.0)
annotate (>= 2.4.0)
guard (>= 0.2.2)
And the endless issue is metioned here https://github.com/cpjolicoeur/guard-annotate/issues/2
So the issue is that the guard-annotate keep restarting to die,
and every time it runs, it trying to save the config/routes.rb
file.
Which will restart your rails as your Guardfile rules saying so.
Every now and then Guard keeps restarting and stopping Rails repeatedly. I have to exit Guard and restart it to stop this problem. For instance when I run a Rake task to recreate the database and add sample data I get something like this: