Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Guard::RSpec error: No cmd option specified, unable to run specs

Tags:

After upgrading to guard 2.6.1 guard stopped executing specs for changed file

13:27:09 - INFO - LiveReload is waiting for a browser to connect.  13:27:09 - INFO - Guard::RSpec is running  13:27:09 - INFO - Guard is now watching at '[path to project]' 13:27:13 - INFO - Running: spec/models/[some_model]_spec.rb 13:27:13 - ERROR - No cmd option specified, unable to run specs! 

My bundle is

Using guard (2.6.1) Using guard-livereload (2.3.0) Using guard-rails (0.5.3) Using guard-rspec (4.3.1)  Using rspec-core (2.14.8) Using rspec-expectations (2.14.5) Using rspec-mocks (2.14.6) Using rspec (2.14.1) Using rspec-rails (2.14.2) Using rails (4.0.4) 
like image 734
Sergiy Seletskyy Avatar asked Jul 30 '14 10:07

Sergiy Seletskyy


1 Answers

You need to update your Guardfile and add the cmd option.

Guard::RSpec 4.0 now uses a simpler approach with the new cmd option that let you precisely define which rspec command will be launched on each run. This option is required due to the number of different ways possible to invoke rspec, the template now includes a default that should work for most applications but may not be optimal for all.

This is how looks my Guardfile:

guard :rspec, cmd: "bundle exec rspec" do   # ... end 
like image 62
Arturo Herrero Avatar answered Sep 18 '22 20:09

Arturo Herrero