How to set up a Rails 7 app with Devise gem for user authentication

On submitting the sign up form, you may run into this error:
NoMethodError in Devise::RegistrationsController#create

undefined method `user_url' for #<Devise::RegistrationsController:0x0000000000da98>

-----------------------------------------------
Please answer a few questions to help us make even better lessons for you.