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

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

    Codeglot's anwser above does the job, but we wanted something a bit more flexible, so we did this:

    On Heroku, we run multiple Production environments for staging and testing, so we need a flexible solution for the production.rb environment file.

    In production.rb

    config.action_mailer.default_url_options = { :host => ENV['MAILER_URL'] }
    

    Then set the MAILER_URL environment variable for your app like so

    heroku config:set MAILER_URL=my-awesome-app.herokuapp.com --app my-awesome-app
    

提交回复
热议问题