あなたのプロジェクトのgithubページを共有してください。次に、本番サーバーのログも共有します。 heroku logs
で回復できます。私は私のアプリのためにこれを設定した、結局それは壊れた。それは少し難しいです。私はいくつかのガイドに従った。あなたが同じ引用をしたならば、あなたが従ったガイド。私はこのガイドに従って、私は自分のアプリケーションからGmailアカウントの使用を設定する私のGmailアカウントを許可しなければならなかったことを覚えています。
Setting Up Production Environment
Now you will need to edit the file “config/environments/production.rb”. We will be adding very similar things to this file. First you can add:
config.action_mailer.default_url_options = { :host => 'yoursite.herokuapp.com' }
NOTE: You may also need to add this line. When I was setting up the mailer, I did not find this line in any other tutorials. I had the development mailer working, however I could not get heroku to work. I received this error in the heroku logs:
ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
:その後、私は
guideを引用しています、あなたが
production.rb
で行う必要があるいくつかの設定があり、完全なガイドを参照してくださいし、オンラインにも他のガイドをチェックするためにそのリンクにアクセスしてください
I found the answer here: ActionView::Template::Error: Missing host to link to on stackoverflow. If you come across this, then add:
Rails.application.routes.default_url_options[:host] = 'yoursite.herokuapp.com'
to your production.rb file.
Next you will have to add in these lines. Once again make sure that you leave the variables as they are.
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"
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: ENV["GMAIL_DOMAIN"],
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["GMAIL_USERNAME"],
password: ENV["GMAIL_PASSWORD"]
}
これを設定するには、この記事のコメントや他のすべての関連のガイドを読んで、あなたはどのようにあなたがメールを送信している
....電子メールを送信するためにいくつかの
smtp
APIを使用する必要があるかもしれませんか?ログを確認します。それはあなたに何が起こっているのかという手がかりを与えます。そうすれば、修正を見つけるのは簡単です。 –、リカバリパスワードはProductionでのみ送信されますか?あなたは確かですか、あなたは正しく生産をテストしませんでしたか? –