4

I am working on ubuntu machine with Ruby-1.9.2 and rails-3.1.3. I am using guard-rspec for autotesting and spork as DRB server.

When I run guard without spork, it shows the correct notifications. But guard with spork shows no notifications at all.
Here is relevant part of my Gemfile

group :test, :development do
    gem 'rake', '0.9.3.beta.1'
    gem 'turn'
    gem 'rspec-rails'
    gem 'rspec'
    gem 'guard-rspec'
    gem 'spork'
    gem 'webrat'
    gem 'rb-fchange'
    gem 'rb-fsevent'
    gem 'libnotify'
end
user229044
  • 232,980
  • 40
  • 330
  • 338

1 Answers1

2

I know it is an old question, but found via Google and just struggle with same problem.

Solution is quite easy.

Use guard-spork (https://github.com/guard/guard-spork)

  gem 'guard-rspec'
  gem 'guard-spork'
  gem 'libnotify'

Add at the top of Guardfile (before rspec definition):

guard 'spork' do
  watch('config/application.rb')
  watch('config/environment.rb')
  watch(%r{^config/environments/.*\.rb$})
  watch(%r{^config/initializers/.*\.rb$})
  watch('Gemfile')
  watch('Gemfile.lock')
  watch('spec/spec_helper.rb') { :rspec }
  watch('test/test_helper.rb') { :test_unit }
  watch(%r{features/support/}) { :cucumber }
end

run

bundle exec guard
Piotr Mąsior
  • 1,580
  • 1
  • 11
  • 20
  • That worked for me too (Ubuntu 12.04 LTS), thanks! Can you explain what the change to the guard block does and why it's needed? I'm still trying to get to grips with ruby on rails etc. – Tim Abell May 24 '13 at 09:49
  • Found matching tutorial code: http://ruby.railstutorial.org/chapters/static-pages?version=4.0#sec-spork_and_guard – Tim Abell May 24 '13 at 09:59