Shruti Jain
Shruti Jain

Reputation: 21

rails generate cucumber:install fails with "Could not load generator"

I tried to install Cucumber, but rails g cucumber:install shows an error in the terminal:

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

Here is the part of my Gemfile with 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

Here's my entire 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'

Upvotes: 2

Views: 300

Answers (1)

Dave Schweisguth
Dave Schweisguth

Reputation: 37607

It's possible that spring is started and is unable to load the generator. Try

DISABLE_SPRING=1 rails g cucumber:install

Upvotes: 2

Related Questions