Rspec: Could not find generator 'rspec:install'. Maybe you meant 'assets', 'channel' or 'scaffold'

⏹️ Introduction

rspec-rails brings the RSpec testing framework to Ruby on Rails as a drop-in alternative to its default testing framework, Minitest.

Rspec looks a lot like plain English.


⏹️ What's the error message?

Could not find generator 'rspec:install'. Maybe you meant 'assets', 'channel' or 'scaffold'

The error message says that it was not possible to find the above generator.

![Check free icon](cdn-icons-png.flaticon.com/512/5610/5610944.. align="left" height=16px width=16px)


⏹️ When does it happen?

It happens when you try to run rails generate rspec:install

rails generate rspec:install

⏹️ How to solve the error?

Make sure that:

  1. ✅ The command is spelled correctly

    rails generate rspec:install

  2. ✅ Rspec gem is inside :development and :test blocks (Gemfile)

    gem 'rspec-rails'

  3. ✅ Rspec is installed

    gem list rspec

  4. ✅ Stop spring

    bin/spring stop

    This one worked for me.

  5. ✅Try again

    rails generate rspec:install

    You should see something like this

  6. ✅Celebrate


⏹️ Conclusion

In this article, we learned how to setup rspec on Ruby on Rails.

Let me know if you need any additional help.