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

前端 未结 6 2049
南方客
南方客 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:46

    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.

提交回复
热议问题