Could not find rspec: install generator.

I am trying to follow this guide here: http://railstutorial.org/chapters/static-pages#top

When I run:

$ rails generates rspec: install

I get:

Could not find rspec: install generator.

What could be the problem if I use Rails 3.0.0.rc?

Thank.

+48
rspec
Aug 06 '10 at 17:55
source share
9 answers

Add to your Gemfile:

group :development, :test do gem 'rspec-rails', ">= 2.0.0.beta" end 

and run the package

Installed nokogiri and then rails generate rspec:install works as expected.

+74
Aug 23 2018-10-18T00:
source share

Make sure you install rspec-rails and not just rspec . Sigh, I lost some time.

+14
02 Sep '14 at 11:56 on
source share

I did both gem install rspec and then added to the gemfile as Andreas said.

using Rails 3.2.1 and ruby ​​1.9.3 on Windows 7 and worked fine.

+4
Mar 22 '12 at 19:17
source share

Add the gem 'rspec-rails' to the Gemfile and save it. Run the bundle command in the terminal. And in config/application.rb add this configuration line

 config.generators do |g| g.test_framework :rspec, :fixture => true, :views => false g.integration_tool :rspec, :fixture => true, :views => true end 
+2
Jul 18 '13 at 8:56
source share

Try setting it like a gem.

gem install rspec

with rails 3 in your config / environment.rb you support gems there with the installation of the package, but in terms of what you are doing, you can simply install gs install rspec.

+1
Aug 6 2018-10-06T00:
source share

I got the same error and found that I forgot to save the Gemfile changes I made in Sublime before running the Bundle install command. I saved and then restarted the installation of the package and was able to run rails generate rspec: install command

+1
Nov 14 '12 at 15:58
source share

I realized that I was not saved after updating my Gemfile . I just saved, ran bundle install on the command line, and finally ran $ rails generate rspec:install

0
Feb 12 '14 at 16:14
source share

Uninstall all versions of rspec by running the following commands suggested by Sydney in another post, and then install -V 2.0.1

 gem uninstall rspec gem uninstall rspec-core rspec-expectations rspec-mocks rspec-support gem install rspec -v 2.0.1 

add the following line to the gem file

 gem 'rspec-rails', '~> 2.0.0' 

and then run

 rails generate rspec:install 

It works without any problems.

0
Apr 19 '16 at 11:06 on
source share

By default, I only had 'rspec-rails' in my gemfile, and therefore for some reason the package installed rspec-rails 1.x (some prehistoric version). After I changed my gemfile to have gem 'rspec-rails', '~>3.0' and start updating the package, it went fine.

0
Jul 20 '17 at 8:15
source share



All Articles