Heroku/devise - Missing host to link to! Please provide :host parameter or set default_url_options[:host]

前端 未结 6 2030
南方客
南方客 2020-11-28 01:51

I am trying to push my app on heroku. I am still in dev. I use devise with the confirmable module.

When I try to add a user with the heroku console I got this error:<

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 02:54

    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..

提交回复
热议问题