1

运行黄瓜时出现以下错误。我在这里看过这篇文章和其他类似的文章,但没有运气。

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)>'

我有 spork 和 guard 正在运行,但即使我没有运行它们,我也会收到此错误。我正在运行 Mongoid,我在 Windows 上。

我的宝石文件:

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'
4

1 回答 1

1

在 Gemfile 中试试这个。

gem "cucumber-rails", "1.0.5"

并重新运行安装程序

script/rails g cucumber:install your-language --your-options
于 2012-11-20T04:43:24.230 回答