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

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

    If you're running on Cedar:

    1. run heroku addons:add sendgrid:free from your console.

    2. Add the following lines to config/environments/production.rb in your app.

    .

      ActionMailer::Base.smtp_settings = {
        :address        => 'smtp.sendgrid.net',
        :port           => '587',
        :authentication => :plain,
        :user_name      => ENV['SENDGRID_USERNAME'],
        :password       => ENV['SENDGRID_PASSWORD'],
        :domain         => 'heroku.com'
      }
    
      ActionMailer::Base.delivery_method = :smtp
    
      config.action_mailer.default_url_options = { :host => 'YOUR-DOMAIN-HERE.COM' }
    

提交回复
热议问题