views:

410

answers:

1

I'm trying to start my rails 3 app in the same environment that cucumber uses because this is necessary for a particular test. When I try to start the server via rails server -e cucumber I get this error:

/home/james/rails-projs/fact/config/environments/cucumber.rb:7: undefined local variable or method `config' for main:Object (NameError)
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:523:in `new_constants_in'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application/bootstrap.rb:10
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:25:in `instance_exec'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:25:in `run'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:55:in `run_initializers'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:54:in `each'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:54:in `run_initializers'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application.rb:109:in `initialize!'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application.rb:81:in `send'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application.rb:81:in `method_missing'
from /home/james/rails-projs/beta/config/environment.rb:6
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:523:in `new_constants_in'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
from /home/james/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
from config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1

I'd appreciate any help.

A: 

I have a similar issue. Not on cucumber, but on a rake task, same error

CLod