[RUBY] [Rails] After introducing (intentionally) devise, the command stopped working

I introduced devise while creating an application with Ruby on Rails. When I tried to create a database with rails db: create after installation,

undefined method `devise' for Install (call 'Install.connection' to establish a connection):Class (NoMethodError)

I got the error. The rails s command also doesn't work.

Cause

If you search the latest input history with the history command,

bundle install
rails g devise install
rails db:create
rails s

Where I should have typed rails g devise: install, I was typing rails g devise install. I forgot to write :. It seems that devise was not installed in the first place.

Countermeasures

A model called install.rb has already been created, so delete it.

Routing in config/route.rb

config/route.rb


devise_for :installs

First delete the description of.

Rails d devise install

Enter the command.

Rails g devise:install

It is OK to execute again.

Reference article

https://qiita.com/ryouzi/items/9c5324ba567109ab2a22

Recommended Posts

[Rails] After introducing (intentionally) devise, the command stopped working
[rails] The case where the server stopped working
[Rails] Introducing devise
[Rails] Processing after adding a column to the devise table
The process of introducing Vuetify to Rails
Introducing devise
[Rails] devise
Introducing devise
The road to Japaneseizing Rails devise error messages
[Docker for Windows] The Docker app suddenly stopped working ...