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.
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.
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.
https://qiita.com/ryouzi/items/9c5324ba567109ab2a22
Recommended Posts