Rails 4.2.7 guard-rspec 4.7.3
自从我安装了ember-cli-rails,就会阻止guard-spec运行并触发数百个错误。 以下是其中一个错误:
Directory: /home/sylvain/dev/placedemarche/marketadmin/tmp/broccoli_merge_trees-output_path-rlX3b4rm.tmp/marketadmin/tests/unit
is already being watched through: /home/sylvain/dev/placedemarche/marketadmin/tmp/broccoli_persistent_filterbabel__babel_marketadmin-output_path-Nv8C3Z67.tmp/marketadmin/tests/unit
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
** ERROR: directory is already being watched! **
我在guardfile中尝试了多种方法,甚至删除了所有的watch:
guard 'rspec',:cli => "--drb --format progress",all_after_pass: false do
# ignore /marketadmin/
# watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
# watch('spec/spec_helper.rb') { "spec" }
# # Rails example
# watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
# watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
# watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
# watch('config/routes.rb') { "spec/routing" }
# watch('app/controllers/application_controller.rb') { "spec/controllers" }
# # Capybara request specs
# watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
我尝试了多个版本的ignore,但仍然失败。
问题基本上在于,Ember用于生成预览应用程序的tmp文件夹会让guard变得混乱。而且似乎guard ignore并不能真正使guard避免扫描该文件夹。
我该如何使guard文件忽略Ember文件夹,以便我可以恢复rspec-guard?
编辑
我已经按照以下方式编辑了guardfile:
guard 'rspec',:cli => "--drb --format progress",all_after_pass: false do
ignore(%r{^marketadmin/(.+)})
end
它仍然失败并显示以下错误(有很多错误,我不得不将终端内存设置为30,000行,20,000不够):
18:24:39 - INFO - Guard::RSpec is running
18:24:39 - DEBUG - Hook :start_end executed for Guard::RSpec
D, [2017-08-24T18:25:00.166155 #20128] DEBUG -- : Waiting for processing to start...
18:25:00 - INFO - Guard is now watching at '/home/sylvain/dev/placedemarche'
18:25:00 - DEBUG - Start interactor
** ERROR: directory is already being watched! **
Directory: /home/sylvain/dev/placedemarche/marketadmin/tmp/funnel-input_base_path-WVhWKrYs.tmp
is already being watched through: /home/sylvain/dev/placedemarche/marketadmin/node_modules/qunit-notifications
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
** ERROR: directory is already being watched! **
Directory: /home/sylvain/dev/placedemarche/marketadmin/tmp/funnel-input_base_path-ULeE6XMF.tmp
is already being watched through: /home/sylvain/dev/placedemarche/marketadmin/app
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
watch
忽略/.*/
以查看是否可以屏蔽一切内容吗? - BookOfGreg