Skip to content

Instantly share code, notes, and snippets.

@fivetwentysix
Created September 15, 2011 04:41
Show Gist options
  • Save fivetwentysix/1218554 to your computer and use it in GitHub Desktop.
Save fivetwentysix/1218554 to your computer and use it in GitHub Desktop.
[~/Sites/app] cucumber --drb
Using the default profile...
Disabling profiles...
Exception encountered: #<RuntimeError: Application has been already initialized.>
backtrace:
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application.rb:91:in `initialize!'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-rails-1.0.2/lib/cucumber/rails/application.rb:15:in `initialize!'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/pma/Sites/app/config/environment.rb:5:in `<top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `block in load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime.rb:137:in `load_step_definitions'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/runtime.rb:39:in `run!'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.0.6/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/test_framework/cucumber.rb:24:in `run_tests'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/run_strategy/forking.rb:13:in `block in run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/forker.rb:21:in `block in initialize'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/forker.rb:18:in `fork'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/forker.rb:18:in `initialize'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0.rc9/lib/spork/server.rb:48:in `run'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1558:in `perform_without_block'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1518:in `perform'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1592:in `block (2 levels) in main_loop'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1588:in `loop'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1588:in `block in main_loop'
@visoft
Copy link

visoft commented Sep 19, 2011

Did you find a solution to this?

@meltedice
Copy link

For my case, I resolved this problem to add spork configuration into features/support/env.rb.
I don't know why but spork --bootstrap didn't add configuration into env.rb.

Required features/support/env.rb configuration is:

require 'rubygems'
require 'spork'
Spork.prefork do
end
Spork.each_run do
end

So added them by following steps:

  1. % mv spec/spec_helper.rb spec/spec_helper.rb.bak
  2. % spork --bootstrap
  3. % mv spec/spec_helper.rb.bak spec/spec_helper.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment