简体   繁体   中英

Cucumber Error uninitialized constant ActionController::Dispatcher (NameError)

I'm getting the following error when running cucumber. I've looked at this post and other similar on here but no luck.

uninitialized constant ActionController::Dispatcher (NameError)
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/cucumber-rails-0.3.2/lib/cucumber/rails/action_controller.rb:51:in `resc
ue in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/cucumber-rails-0.3.2/lib/cucumber/rails/action_controller.rb:42:in `<top
 (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/cucumber-rails-0.3.2/lib/cucumber/rails/world.rb:27:in `<top (required)>
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/cucumber-rails-0.3.2/lib/cucumber/rails/rspec.rb:2:in `<top (required)>'

I have spork and guard running, but I get this error even if I don't have them running. I'm running Mongoid and I'm on windows.

My gemfile:

source 'https://rubygems.org'
gem 'rails', '3.2.1'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "mongoid", ">= 3.0.9"
gem "haml", ">= 3.1.7"
gem "haml-rails", ">= 0.3.5", :group => :development
gem "hpricot", ">= 0.8.6", :group => :development
gem "ruby_parser", ">= 2.3.1", :group => :development
gem "rspec-rails", :group => [:development, :test]
gem "capybara", ">= 1.1.2", :group => :test
gem "database_cleaner", ">= 0.9.1", :group => :test
gem "mongoid-rspec", ">= 1.4.6", :group => :test
gem "email_spec", ">= 1.2.1", :group => :test
gem "factory_girl_rails", ">= 4.1.0", :group => [:development, :test]
group :development, :test do
  gem 'guard-spork'
  gem 'wdm', '~> 0.0.3'
  gem 'spork'
end
group :test do
    gem "cucumber", ">= 1.1.0"
    #gem "cucumber-rails", ">= 0.3.2"
    gem 'cucumber-rails', :require => false
end
gem "bootstrap-sass", ">= 2.1.0.1"
gem "devise", ">= 2.1.2"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.0.4"
gem "quiet_assets", ">= 1.0.1", :group => :development
gem 'thin'
gem 'coffee-filter'
gem 'ruby-units'
gem 'execjs'
gem 'fullcalendar-rails'
gem 'bootstrap-timepicker-rails'

Try this in Gemfile.

gem "cucumber-rails", "1.0.5"

And rerun installer

script/rails g cucumber:install your-language --your-options

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM