Heroku/devise - Missing host to link to! Please provide :host parameter or set default_url_options[:host]
You need to add this to your environment.rb
config.action_mailer.default_url_options = { :host => 'localhost' }
Make sure you change host
to your production url and keep it localhost for development. This is for the mailer, it needs a default email to send out notices such as confirmations etc...
You should check the logs on the heroku server heroku logs
run that from the console and it will tell you the exact error.
When you push to heroku you need to configure the environment.rb
file with the heroku subdomain:
config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
Depending upon version, this should go in production.rb
, not environment.rb
.
Ok,
First you have to install the sendgrid gem with this command line:
heroku addons:add sendgrid:free
Then you just have to configure your env/dev.rb and env/prod.rb like this:
env/dev.rb
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
env/prod.rb
config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
Push on git and heroku. It should work..