ruby-on-rails – Cucumber Rails 3.1未初始化的常量ActionController :: Dispatcher(NameError)

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Cucumber Rails 3.1未初始化的常量ActionController :: Dispatcher(NameError)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Rails 3.1应用程序,我正在将黄瓜集成到我的应用程序中,但是当我尝试运行它时,我得到了这个奇怪的错误,有人可以帮助我吗?
Using the default profile...
uninitialized constant ActionController::Dispatcher (NameError)
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-rails-0.3.2/lib/cucumber/rails/action_controller.rb:51:in `rescue in <top (required)>'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-rails-0.3.2/lib/cucumber/rails/action_controller.rb:42:in `<top (required)>'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-rails-0.3.2/lib/cucumber/rails/world.rb:27:in `<top (required)>'
/Users/chinog9/INNKU/tacos/features/support/env.rb:11:in `<top (required)>'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_language.rb:143:in `load'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:176:in `load_file'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:78:in `block in load_files!'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:77:in `each'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:77:in `load_files!'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:137:in `load_step_definitions'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:39:in `run!'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:20:in `execute'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/bin/cucumber:14:in `<top (required)>'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/bin/cucumber:19:in `load'
/Users/chinog9/.rvm/gems/ruby-1.9.2-p180/bin/cucumber:19:in `<main>'

这是我的env.rb:

ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')

require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
require 'cucumber/web/tableish'

require 'capybara/rails'
require 'capybara/cucumber'
require 'capybara/session'
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript

Capybara.default_selector = :css

ActionController::Base.allow_rescue = false


Cucumber::Rails::World.use_transactional_fixtures = true

if defined?(ActiveRecord::Base)
  begin
    require 'database_cleaner'
    DatabaseCleaner.strategy = :truncation
  rescue LoadError => ignore_if_database_cleaner_not_present
  end
end

这是我的Gemfile:

source 'http://rubygems.org'

gem 'rails','3.1.0.rc4'

gem 'sqlite3'
gem 'nifty-generators'

gem 'sass-rails',"~> 3.1.0.rc"
gem 'coffee-script'
gem 'uglifier'

gem 'jquery-rails'

gem 'ruby-debug19',:require => 'ruby-debug'

group :development,:test do 
    gem 'capybara'
    gem 'database_cleaner'
    gem 'cucumber-rails'
    gem 'cucumber'
    gem 'rspec-rails','>=2.6'
    gem 'rspec-rails-mocha'
    gem 'spork','~> 0.9.0.rc'
    gem 'factory_girl_rails'
    gem 'launchy'
    gem "ruby-debug19"
    gem 'turn',:require => false
    gem "selenium-client"
end

gem "mocha",:group => :test

谢谢! 原文链接:https://www.f2er.com/ruby/274184.html

猜你在找的Ruby相关文章