Rails チュートリアル 11章の最後、本番環境にデプロイし、新規ユーザー登録の画面で"create my account" ボタンを押すと、下記のサインが出てきます。deployする前のrails testは全てグリーン、おそらくコードも間違いはないと思うのですが、config/environments/production.rb の該当箇所だけ下記いたします。何とか乗り越えたいと願っております。不足しております情報がありましたらご教示ください。何卒ご指導のほどよろしくお願いいたします。
<Herokuのサイン>
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
<herokuのログ>
2020-06-24T12:10:45.771082+00:00 app[web.1]:
2020-06-24T12:10:45.771082+00:00 app[web.1]: ----==_mimepart_5ef342c5b907b_a2b1320468f1c70566--
2020-06-24T12:10:45.771083+00:00 app[web.1]:
2020-06-24T12:10:45.771633+00:00 app[web.1]: I, [2020-06-24T12:10:45.771557 #10] INFO -- : [5586b325-0aec-4c69-ba59-808108915ad3] Completed 500 Internal Server Error in 1340ms (ActiveRecord: 14.7ms | Allocations: 6005)
2020-06-24T12:10:45.773148+00:00 app[web.1]: F, [2020-06-24T12:10:45.772901 #10] FATAL -- : [5586b325-0aec-4c69-ba59-808108915ad3]
2020-06-24T12:10:45.773149+00:00 app[web.1]: [5586b325-0aec-4c69-ba59-808108915ad3] ArgumentError (SMTP-AUTH requested but missing secret phrase):
2020-06-24T12:10:45.773150+00:00 app[web.1]: [5586b325-0aec-4c69-ba59-808108915ad3]
2020-06-24T12:10:45.773150+00:00 app[web.1]: [5586b325-0aec-4c69-ba59-808108915ad3] app/models/user.rb:55:in send_activation_email' 2020-06-24T12:10:45.773151+00:00 app[web.1]: [5586b325-0aec-4c69-ba59-808108915ad3] app/controllers/users_controller.rb:28:in
create'
2020-06-24T12:10:45.774894+00:00 heroku[router]: at=info method=POST path="/users" host=guarded-wildwood-41214.herokuapp.com request_id=5586b325-0aec-4c69-ba59-808108915ad3 fwd="58.159.14.129" dyno=web.1 connect=0ms service=1359ms status=500 bytes=1891 protocol=https
<config/environments/production.rb の環境設定>
Ruby
1 #11.41 Railsのproduction環境でSendGridを使う設定 2 # Set this to true and configure the email server for immediate delivery to raise delivery errors. 3 config.action_mailer.raise_delivery_errors = true 4 config.action_mailer.delivery_method = :smtp 5 host = 'guarded-wildwood-41214.herokuapp.com' 6 config.action_mailer.default_url_options = { host: host } 7 ActionMailer::Base.smtp_settings = { 8 :address => 'smtp.sendgrid.net', 9 :port => '587', 10 :authentication => :plain, 11 :user_name => ENV['SENDGRID_USERNAME'], 12 :user_password => ENV['SENDGRID_PASSWORD'], 13 :domain => 'heroku.com', 14 :enable_starttls_auto => true 15 }
あなたの回答
tips
プレビュー