rails 4 - 找不到生成器 rspec:install [英] rails 4 - Could not find generator rspec:install

查看:34
本文介绍了rails 4 - 找不到生成器 rspec:install的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装用于 TDD 和 BDD 测试的 rspec 框架,以及用于在更改完成的同时运行的连续测试的 autotest gem.

Im trying to install the rspec framework for TDD and BDD testing, and also the autotest gem for a continuos testing running at the same time the changes are done.

我一直在关注各种教程,其中一些在堆栈溢出中,而另一些则在网络上,但是在执行

I have been following all kind of tutorials, some of them here in stack overflow and others out there in the web, but i couldnt reach a solution, when executing the

rails 生成 rspec:install

rails generate rspec:install

它给我一个错误'找不到生成器 rspec:install'.

我在这里附上 gem 文件:[更新]

I attach the gem file here: [UPDATED]

source 'https://rubygems.org'

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

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# 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', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

group :development, :test do 
    gem 'rspec-rails', '2.13.1' 
end

推荐答案

将 Gemfile 中的内容更改为以下内容并保存

Change what you have in your Gemfile to what is below and save

 group :development, :test do
   gem 'rspec-rails', '2.13.1'
 end

然后运行 ​​bundle update 和 bundle install

Then run bundle update and then bundle install

这篇关于rails 4 - 找不到生成器 rspec:install的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆