Ruby on Rails-Cucumber - 错误:找不到生成器黄瓜:安装

时间:2014-08-13 18:43:29

标签: ruby-on-rails cucumber

我是RoR和Cucumber的新手。我已经安装了RoR和Cucumber并且正在逐步完成Cucumber Backgrounder(https://github.com/cucumber/cucumber/wiki/Cucumber-Backgrounder

当我进入这一步时:运行" rails生成黄瓜:安装"我收到错误:找不到生成器黄瓜:安装

我回顾了一个与JRuby相关的非常相似的问题:

Jruby and Cucumber / Cucumber Rails - Could not find generator cucumber:install

我已经尝试了所有建议(尽我所能)并仍然收到错误消息。 (设置GEM_HOME和GEM_PATH变量,修改Gemfile等)

我的Gemfile:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# 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

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]

# added by SC to get cucumber to install
group :test do
  gem 'cucumber-rails', :require => false
  # database_cleaner is not required, but highly recommended
  gem 'database_cleaner'
end

当我运行bundle install时,我注意到黄瓜和黄瓜栏不在列表中。 我设法在本地安装,但这并没有解决问题。

任何建议都表示赞赏。

1 个答案:

答案 0 :(得分:1)

您需要在以下组中添加GemFile:development,:test

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

下次使用:

rails g cucumber:install

就是这样