rails生成黄瓜:安装失败,"无法加载生成器"

时间:2016-05-25 15:18:46

标签: ruby-on-rails ruby cucumber

我尝试安装Cucumber,但rails g cucumber:install在终端中显示错误:

[WARNING] Could not load generator "generators/cucumber/install/install_generator". Error: uninitialized constant Cucumber::Generators::InstallBase::Config.

以下是我的Gemfile中使用cucumber-rails的部分:

group :test do
    gem 'faker'
    gem 'capybara'
    gem 'guard-rspec'
    gem 'cucumber-rails', :require => false
    gem 'database_cleaner'
    gem 'selenium-webdriver'
    gem 'gherkin'
    gem "launchy", "~> 2.1.2"
end

这是我的整个Gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '4.2.5'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.15'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes gem 'therubyracer', platforms: :ruby
gem 'devise'

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'therubyracer'
gem 'cancan'
gem 'roo'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'bcrypt-ruby', :require => 'bcrypt'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
# Use Unicorn as the app server
# gem 'unicorn'
gem 'birthday'
gem 'pry-nav'
gem 'unread'
gem 'week_of_month'
gem 'city-state'
gem 'carmen-rails'
gem "nested_form"
gem 'prawn'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'prawn-table', '~> 0.1.0'
gem 'rails_12factor', group: :production
gem 'whenever', require: false
gem 'simplecov', :require => false, :group => :test
#Image uploading
gem 'carrierwave'
gem 'carrierwave-dropbox'
gem 'client_side_validations'
#Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'bootstrap-datepicker-rails', :require => 'bootstrap-datepicker-rails',
                              :git => 'git://github.com/Nerian/bootstrap-datepicker-rails.git'
gem 'fullcalendar-rails'
gem 'simple_form'
gem 'momentjs-rails'

gem 'google-api-client'
gem 'omniauth'
gem 'omniauth-google-oauth2', :git => 'https://github.com/zquestz/omniauth-google-oauth2.git'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug'
    #gem "rspec-rails"
    gem 'factory_girl_rails'
end

group :test do
    gem 'faker'
    gem 'capybara'
    gem 'guard-rspec'
    gem 'cucumber-rails', :require => false
    gem 'database_cleaner'
    gem 'selenium-webdriver'
    gem 'gherkin'
    gem "launchy", "~> 2.1.2"
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
    gem 'web-console', '~> 2.0'
    gem 'will_paginate'
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
end
gem 'bootstrap-sass', '~> 3.3.5'
gem 'bootstrap-timepicker-rails-addon', :require => 'bootstrap-timepicker-rails-addon',
                                        :git => 'git://github.com/ywjno/bootstrap-timepicker-rails-addon.git'

1 个答案:

答案 0 :(得分:2)

弹簧可能启动并且无法加载发电机。尝试

DISABLE_SPRING=1 rails g cucumber:install