Rspec-rails: rails g rspec:install doesn't work with Rails 5.0.0beta2 --api

Created on 4 Feb 2016  路  12Comments  路  Source: rspec/rspec-rails

I created an rails api with the latest version of rails (Rails 5.0.0.beta2) and have the following rspec gems installed:

  • rspec (3.4.0)
  • rspec-core (3.4.2)
  • rspec-expectations (3.4.0)
  • rspec-mocks (3.4.1)
  • rspec-support (3.4.1)

when I try to run

rails g rspec:install

I get the following error message:

Could not find generator 'rspec:install'. Maybe you meant 'assets', 'channel' or 'scaffold'
Run rails generate --help for more options.

I assume it is a bug with rails 5, but mb I just missed something very obvious.
I just started using rspec.

Most helpful comment

I run:
spring stop

And then again:
rails generate rspec:install

But I get the same error:
Running via Spring preloader in process 1194 Could not find generator 'rspec:install'. Maybe you meant 'assets', 'channel' or 'scaffold'

What to do?

Thank you!

All 12 comments

@Elux91 did you try off RSpec master? specifically, you'll want to have the following lines in your gemfile:

gem "rspec-core", :github => "rspec/rspec-core"
gem "rspec-expectations", :github => "rspec/rspec-expectations"
gem "rspec-mocks", :github => "rspec/rspec-mocks"
gem "rspec-support", :github => "rspec/rspec-support"
gem "rspec-rails", :github => "rspec/rspec-rails"

We haven't released a version of RSpec with rails 5 support yet, so until we do, you'll have to pull from git. If this works for you, let us know, if it doesn't, very let us know.

@samphippen @Elux91: FYI rails g rspec:install on RSpec master works fine for me!

@jordanyee can you try the RSpec 3.5.0.beta1 release?

thank is working

@samphippen works like a charm ;)

How do I use this RSpec master?

I have this issue:
Jonass-MBP:sample_app Money$ rails g rspec:install Running via Spring preloader in process 48656 Could not find generator 'rspec:install'. Maybe you meant 'assets', 'channel' or 'scaffold' Runrails generate --helpfor more options.

Even after I insert the following in the Gem file, the above error persist:
gem "rspec-core", :github => "rspec/rspec-core" gem "rspec-expectations", :github => "rspec/rspec-expectations" gem "rspec-mocks", :github => "rspec/rspec-mocks" gem "rspec-support", :github => "rspec/rspec-support" gem "rspec-rails", :github => "rspec/rspec-rails"

THank you!

You need to restart spring every time you do a bundle install.

I run:
spring stop

And then again:
rails generate rspec:install

But I get the same error:
Running via Spring preloader in process 1194 Could not find generator 'rspec:install'. Maybe you meant 'assets', 'channel' or 'scaffold'

What to do?

Thank you!

Problem solved.
1.
gem install sqlite3
2
gem list sqlite3
3.
Change sqlite3 version number in Gemfile.
4.
bundle install
5.
rails generate rspec:install

@JonasPreisler It doesn't work for me.
For step 3, does it mean that sqlite3 version has to be set as concrete version, i.e '1.3.13'?

Added the gem entries on the gem files - saves
Stopped the spring server
Restarted the spring server
Still getting the error

RSpec 3.6

  • rspec-core 3.6.0
  • rspec-expectations 3.6.0
  • rspec-mocks 3.6.0
  • rspec-rails 3.6.1
  • rspec-support 3.6.0

I had the same problem. I was using gem rspec instead of gem 'rspec-rails', '~> 3.7'.

Was this page helpful?
0 / 5 - 0 ratings