I’ve been learning Rails for awhile now and I just recently started using Devise for user authentication. It’s been great until I got stuck on the following Error:

ArgumentError in Devise::Passwords#create

Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
Extracted source (around line #5):

Someone has requested a link to change your password. You can do this through the link below.

@token) %>

If you didn’t request this, please ignore this email.

Your password won’t change until you access the link above and create a new one.

I spent some time on Google and none of the solutions I found seemed to work at all. I was getting frustrated so I ran some updates and rebooted and sure enough, when I restarted the rails server the emails worked. It would appear the config methods in the environment files don’t reload unless the server is restarted. Hopefully this is helpful to anyone else who is going through the same thing.

The code that finally worked for me in my development.rb file (after I rebooted) was: