guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

Why I can't start Spork using Guard? #105

Closed hopewise closed 11 years ago

hopewise commented 11 years ago

I've followed the steps in Rayan cast here : http://railscasts.com/episodes/285-spork?view=asciicast

to use guard with spork, here is what I get:

$guard
16:02:28 - INFO - Guard uses NotifySend to send notifications.
16:02:28 - INFO - Guard uses TerminalTitle to send notifications.
16:02:28 - INFO - Starting Spork for RSpec, Test::Unit
Using RSpec
Couldn't find a supported test framework that begins with 'testunit'

Supported test frameworks:
( ) Cucumber
(*) RSpec

Legend: ( ) - not detected in project   (*) - detected
Preloading Rails environment

Loading Spork.prefork block...

Rack::File headers parameter replaces cache_control after Rack 1.5.
Spork is ready and listening on 8989!
16:02:58 - ERROR - Could not start Spork server for RSpec, Test::Unit after 30 seconds. I will continue waiting for a further 60 seconds.

^[[A^[[BRunning tests with args ["--drb", "-f", "progress", "-r", "/home/dcaclab/.rvm/gems/ruby-1.9.3-p362@refinery_dcaclab/gems/guard-rspec-2.4.0/lib/guard/rspec/formatter.rb", "-f", "Guard::RSpec::Formatter", "--failure-exit-code", "2", "spec"]...
Done.

How can I start Spork for RSpec only ( without Test::Unit ) ? as I think this is the problem?

Here is my Guardfile:

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
  watch('config/application.rb')
  watch('config/environment.rb')
  watch(%r{^config/initializers/.+\.rb$})
  watch('Gemfile')
  watch('Gemfile.lock')
  watch('spec/spec_helper.rb') { :rspec }
end

guard 'rspec', :cli => "--drb" do
  watch(%r{^spec/.+_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 features specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/features/#{m[1]}_spec.rb" }

  # Turnip features and steps
  watch(%r{^spec/acceptance/(.+)\.feature$})
  watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$})   { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end

Here is my Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.11'

gem 'rake' , '>= 10.0.1'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem "rmagick", "~> 2.13.1"
gem "paperclip", "~> 3.0"
gem 'aws-sdk'
gem "fog"

gem "tweet-button"

gem 'pg'
gem 'google-analytics-rails'
gem 'jquery-rails-cdn'
gem 'spinjs-rails'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby
  gem 'less-rails-bootstrap'
  gem 'uglifier', '>= 1.0.3'
end

gem 'devise'

gem 'omniauth'
#gem 'omniauth-facebook'
gem 'omniauth-facebook', '1.4.0'
gem "koala", "~> 1.5.0"
gem 'oauth2'

gem 'cancan'
gem 'routing-filter'

gem 'thin'
gem "simple_form"
gem "cocoon"
gem "jquery-rails"
gem "validate_url"
gem 'haml'

gem "on_the_spot"
gem 'therubyracer'   # important for less
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

gem 'dragonfly'
gem 'refinerycms-i18n'#, '~> 2.1.0.dev', :git => 'git://github.com/refinery/refinerycms-i18n.git'

#Refinery
gem 'refinerycms-core' #You can leave this out if you like. It's a dependency of the other engines.
gem 'refinerycms-dashboard'
gem 'refinerycms-images'
gem 'refinerycms-pages'
gem 'refinerycms-resources'

group :production do
  gem 'newrelic_rpm'
end

group :test, :development do

  gem "letter_opener"

  gem 'meta_request', '0.2.0'

  gem "rspec-rails"

  gem 'guard-rspec'
  gem "spork"
  gem 'guard-spork'

  gem 'rb-fsevent' # Not mandatory for guard to work, which is why it's not a dependency, but it is an optimization

  gem "factory_girl_rails"

  gem "mocha"
  gem 'capybara' #, :git => 'git://github.com/jnicklas/capybara.git'

  gem 'launchy'
  gem "capybara-webkit"

  gem "nifty-generators"

  gem 'sextant'

  gem 'haml-rails'
  gem 'hpricot'
  gem 'ruby_parser'

end

p.s: spork bootstrapped with spec & works normally with no problems

thibaudgg commented 11 years ago

Do you still have a test folder in your app? guard-spork will automatically try to launch Spork for testunit if it found one, it can disable with the :test_unit => false option: https://github.com/guard/guard-spork#options

hopewise commented 11 years ago

I've removed test folder, and its working now, thank you.

On Thu, Jan 24, 2013 at 9:52 AM, Thibaud Guillaume-Gentil < notifications@github.com> wrote:

Do you still have a test folder in your app? guard-spork will automatically try to launch Spork for testunit if it found one, it can disable with the :test_unit => false option: https://github.com/guard/guard-spork#options

— Reply to this email directly or view it on GitHubhttps://github.com/guard/guard-spork/issues/105#issuecomment-12640961.

Kind Regards,

Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East