1

I'm using Ruby on Rails 3.2.15 and I want to use spring in order to speed my development. I'm using guard 1.7.0 and rspec 2.13.1.

This is my Guardfile:

guard 'rspec', cmd: 'bundle exec spring rspec --color --fail-fast', all_on_start: false, keep_failed: false, all_after_pass: false, rubygems: false, bundler: false do
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{app/(.+)/(.+)\.rb})                  { |m| "spec/#{m[1]}/#{m[2]}_spec.rb" }
  watch(%r{spec/(.+)/(.+)_spec\.rb})
end

I addded the spring-commands-rspec gem on my Gemfile:

group :development, :test do
  ...
  gem 'spring-commands-rspec'
end

I bundle installed and created the binstubs (bundle exec spring binstub --all), run guard and saved a test in order for guard to run it. Once this was done, I checked spring status, but it said Spring is not running.

I modified the Guardfile to remove the rubygems and bundler options, even removed the bundle exec call in cmd option, but nothing made spring run.

Any idea? Thank you!

Baldrick
  • 23,882
  • 6
  • 74
  • 79
mrcasals
  • 1,151
  • 10
  • 20

1 Answers1

0

First, you can put RSpec options in a .rspec file or .rspec-local file like this:

--color
--fail-fast

That way they are used no matter where rspec is called from.

Second, the best way to work with Guard and Spring is to make sure spring first works properly outside guard, e.g.

spring stop
bin/rspec # if it was generated with spring binstub
spring status

If that doesn't work - maybe it didn't get binstubbed properly. Does RSpec work by itself? (without spring).

If that doesn't work, try the steps here: https://github.com/rails/spring#troubleshooting

(In case spring isn't starting for some other reason)

Cezary Baginski
  • 2,077
  • 15
  • 14