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

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

    I had to do a number of things to get it to work in the production environment: Inside of my production.rb file (/config/environments/production.rb) I added the following:

    Rails.application.routes.default_url_options[:host] = 'myappsname.herokuapp.com'
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.perform_deliveries = true
    config.action_mailer.raise_delivery_errors = false
    config.action_mailer.default :charset => "utf-8"
    

    This is with Rails 4 and Devise 3

提交回复
热议问题