I will summarize what I learned and stumbled every day. If you find any mistakes in the description, please let us know! I'm always helped by other people's articles, so I hope it helps.
Error that user_signed_in helper method is not defined, which can be used in devise.
Describe the following in the Gemfile.
gem 'devise'
Do the following in the terminal:
install gem
bundle install
Create configuration file
rails g devise:install
Create a model that supports the login function
rails g devise user
Create a table related to the login function
bundle exec rake db:migrate
Describe the following in routes.rb
devise_for :users