0

Really weird error hitting my rails app on localhost when I create a new user (using Devise gem) and attempt to get a confirmation email:

ArgumentError in Registrations#create
Showing     /Users/matthewvandenboogart/Sites/certlocal/app/views/devise/mailer/confirmation_instructions.html.erb where line #5 raised:

Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true

For the record, other emails are sending fine from localhost. The only email that seems to pop this error is the initial confirmation email. To top it off, I'm not seeing the error when code is pushed up to staging (on Heroku).

config/development.rb:

 config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

Anyone have insights into what may be going on or where to look to resolve? It's an annoying type error that I would like to resolve so one day it doesn't end up happening on production.

matthewvb
  • 932
  • 2
  • 11
  • 21

1 Answers1

0

You said "other emails are sending fine from localhost. The only email that seems to pop this error is the initial confirmation email"

Hmmm. I am not sure what issue you are getting. but if every email work well except the first email, so I think that email was cached. Try to check your development.rb this line

config.action_mailer.perform_caching = false

If it is true, set it to false.

nvtin
  • 11
  • 2
  • Thanks for looking into this @nvtin. I don't have caching turned on. Trying to set it to false throws an error: `undefined method perform_caching= for ActionMailer`. Looks like that's a Rails 5 thing? (I'm using 4.2.7.1) – matthewvb Jun 09 '17 at 00:29