0

私はプログラミングの初心者で、開発モードで ruby​​ on rails を使用して電子メール確認をプログラムしようとしました。メール確認付きの登録のチュートリアルに従い、heroku のアドオンである sendgrid を使用しました。そこでアカウントを作成し、すべてをインストールしました。

問題は次のとおりです。サインアップして確認リンクが記載された電子メールを取得するときに、リンクを開くと、新しい Web サイト ( 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

initializers/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