0

我是一个编程新手,我尝试在开发模式下使用 ruby​​ on rails 编程电子邮件确认。我遵循了一个使用电子邮件确认注册的教程,他们使用了 sendgrid,一个 Heroku 的插件。我在那里注册了一个帐户并安装了所有东西。

现在问题出在:注册并收到带有确认链接的电子邮件时,如果我打开链接,则会出现在新网站上(http://myapp.herokuapp.com/users/confirmation?confirmation_token=n6RmknbFU5G_uH4NrSZ1)应用程序离线维护 此应用程序现在正在进行维护。请稍后再回来查看。

在此处输入图像描述

所以我不能注册。问题出在哪里?我能做些什么?

在我的 user.db 中,我写了这个:

  class User < ApplicationRecord
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :confirmable
end

在 config/environments/developement.db 我添加了这个:

  config.action_mailer.default_url_options = { :host => 'myapp.herokuapp.com' }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true

在初始化程序/setup_mail.rb 我写道: ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
    :address => 'smtp.sendgrid.net',
    :port => '587',
    :authentication => :plain,
    :user_name => 'redacted@heroku.com',   
    :password => 'redacted',
    :domain => 'https://mysterious-forest-46337.herokuapp.com/',
    :enable_starttls_auto => true
}
4

0 回答 0