title: Cucumber Rails 3.1 uninitialized constant ActionController::Dispatcher (NameError)
body: <p>I am using a Rails 3.1 application and I was integrating cucumber to my app but when i try to run it I get this strange error, can someone help me please?</p>
  
  <pre><code>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 &lt;top (required)&gt;'
  /Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-rails-0.3.2/lib/cucumber/rails/action_controller.rb:42:in `&lt;top (required)&gt;'
  /Users/chinog9/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-rails-0.3.2/lib/cucumber/rails/world.rb:27:in `&lt;top (required)&gt;'
  /Users/chinog9/INNKU/tacos/features/support/env.rb:11:in `&lt;top (required)&gt;'
  /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 `&lt;top (required)&gt;'
  /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 `&lt;main&gt;'
  </code></pre>
  
  <p>Here is my env.rb:</p>
  
  <pre><code>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 =&gt; ignore_if_database_cleaner_not_present
    end
  end
  </code></pre>
  
  <p>And here is my Gemfile:</p>
  
  <pre><code>source 'http://rubygems.org'
  
  gem 'rails', '3.1.0.rc4'
  
  gem 'sqlite3'
  gem 'nifty-generators'
  
  gem 'sass-rails', "~&gt; 3.1.0.rc"
  gem 'coffee-script'
  gem 'uglifier'
  
  gem 'jquery-rails'
  
  gem 'ruby-debug19', :require =&gt; 'ruby-debug'
  
  group :development, :test do 
      gem 'capybara'
      gem 'database_cleaner'
      gem 'cucumber-rails'
      gem 'cucumber'
      gem 'rspec-rails', '&gt;=2.6'
      gem 'rspec-rails-mocha'
      gem 'spork', '~&gt; 0.9.0.rc'
      gem 'factory_girl_rails'
      gem 'launchy'
      gem "ruby-debug19"
      gem 'turn', :require =&gt; false
      gem "selenium-client"
  end
  
  gem "mocha", :group =&gt; :test
  </code></pre>
  
  <p>Thanks! :)</p>