未初始化的常量Cucumber :: Rails :: Database(NameError)

时间:2013-05-10 19:32:21

标签: ruby-on-rails cucumber

当我尝试在我的控制台中运行黄瓜时,我收到此错误..

Rack::File headers parameter replaces cache_control after Rack 1.5.
uninitialized constant Cucumber::Rails::Database (NameError) /path_to/app_name/features/support/env.rb:57:in
“`

这是我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.9'

gem 'pg'

gem 'devise'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem 'therubyracer', :platforms => :ruby
  gem "less-rails"
  gem "twitter-bootstrap-rails", :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'slim'

# Omniauth gems
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-google-oauth2'

# Images
gem 'rmagick', '2.13.2'
gem 'carrierwave'

# feed
gem 'feedzirra'

#cron
gem 'whenever', :require => false

#search
gem 'sunspot_rails'
gem 'sunspot_solr'

#ActiveAdmin
gem 'activeadmin'

group :test do
  gem 'cucumber-rails', :require => false
  gem "rspec-rails"
  gem 'factory_girl_rails'
  gem "email_spec"
  gem "pickle"
  gem 'database_cleaner'
end

group :development do
  gem "rspec-rails"
  gem "thin"
  gem "capistrano"
end

我不知道发生了什么,我猜这可能是一些宝石冲突,但我真的不知道。

我找到了其他answers,但它仍然失败了...... 欢迎任何帮助!

1 个答案:

答案 0 :(得分:0)

出于某种原因,我有一个旧版本的cucumber-rails gem,所以我不得不放

在Gemfile中:

gem 'cucumber-rails', '~> latest_version', :require => false

并运行:

bundle update

一切都开始奏效了!