Open pollcaz opened 7 years ago
I just hit this with Rails 5.1. Similar gemset.
Initially, if I changed my newest example from using a before do...end
to a subject {...}
, the error stopped happening.
Nope. That was a temporary lack-of-crash--when I continued to add to the example, the crash returned. Playing more with before do...end
, subject {...}
, and neither, leads me to think there is no correlation.
It seems to be come and go as I change the example. Very maddening.
It worked for me
Ruby 2.3.3p222
gem 'spring'
gem 'spring-watcher-listen'
gem 'guard', '2.14.1'
gem 'guard-rspec', '4.6.4'
And in the Guard file:
guard :rspec, cmd: 'bundle exec rspec -o ./log/results.txt' do
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_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"] }
end
I'm running 5.2
It looks like spring doesn't have the rspec command, and that's what the error really is, as in there is no file to open because it didn't run.
I fixed it by installing https://github.com/jonleighton/spring-commands-rspec
18:02:24 - ERROR - Guard::RSpec failed to achieve its, exception was:
I'm using guard + rspec + spring + rubocop in my Gemfile I have this gems:
when I try to run all test guard raises many exceptions
and my Guardfile is setting as follows: