herokuでproduction.rbにdeviseの設定を書くことで起動するようにはなったのですが、今度はアプリケーションエラーになってしまいました。
開発環境上でやるとうまくいくのですが、heroku上ではエラーが起こります。
production.rbの内容は以下です。
ruby
1production.rb 2 3 config.action_mailer.default_url_options = {:host =>'herokuのアプリ名' } 4 config.action_mailer.raise_delivery_errors = false 5 config.action_mailer.delivery_method = :smtp 6 config.action_mailer.smtp_settings = { 7 :enable_starttls_auto => true, 8 :address => "heroku.com", 9 :port => 587, 10 :domain => 'smtp.sendgrid.net', 11 :user_name => "send gridのアドレス", #先ほど作成した送信用gmailアドレス 12 :password => "sendgridのパスワード", #2段階認証したアカウントで発行したアプリパスワード 13 :authentication =>:plain 14 }
herokuのログは以下です。
heroku
12020-02-18T15:35:28.456234+00:00 app[api]: Starting process with command `rails db:migrate` by user kingyukiya@icloud.com 22020-02-18T15:35:38.599974+00:00 heroku[run.1764]: State changed from starting to up 32020-02-18T15:35:38.585429+00:00 heroku[run.1764]: Awaiting client 42020-02-18T15:35:38.622420+00:00 heroku[run.1764]: Starting process with command `rails db:migrate` 52020-02-18T15:35:45.756127+00:00 heroku[run.1764]: State changed from up to complete 62020-02-18T15:35:45.737625+00:00 heroku[run.1764]: Process exited with status 0 72020-02-18T15:37:38.725010+00:00 app[web.1]: I, [2020-02-18T15:37:38.724851 #4] INFO -- : [e19e160b-7df1-4060-ba7d-f5015bba2439] Started GET "/" for 106.154.133.70 at 2020-02-18 15:37:38 +0000 82020-02-18T15:37:38.726770+00:00 app[web.1]: I, [2020-02-18T15:37:38.726653 #4] INFO -- : [e19e160b-7df1-4060-ba7d-f5015bba2439] Processing by UsersController#index as HTML 92020-02-18T15:37:38.736543+00:00 app[web.1]: I, [2020-02-18T15:37:38.736411 #4] INFO -- : [e19e160b-7df1-4060-ba7d-f5015bba2439] Completed 401 Unauthorized in 9ms 102020-02-18T15:37:39.403843+00:00 heroku[router]: at=info method=GET path="/" host=afeaer.herokuapp.com request_id=e19e160b-7df1-4060-ba7d-f5015bba2439 fwd="106.154.133.70" dyno=web.1 connect=0ms service=682ms status=302 bytes=927 protocol=https 112020-02-18T15:37:39.741773+00:00 app[web.1]: I, [2020-02-18T15:37:39.741632 #4] INFO -- : [907d8b82-df4f-443f-9bd5-82aa33f550eb] Started GET "/users/sign_in" for 106.154.133.70 at 2020-02-18 15:37:39 +0000 122020-02-18T15:37:39.743033+00:00 app[web.1]: I, [2020-02-18T15:37:39.742938 #4] INFO -- : [907d8b82-df4f-443f-9bd5-82aa33f550eb] Processing by Devise::SessionsController#new as HTML 132020-02-18T15:37:39.846633+00:00 app[web.1]: I, [2020-02-18T15:37:39.846471 #4] INFO -- : [907d8b82-df4f-443f-9bd5-82aa33f550eb] Rendering devise/sessions/new.html.erb within layouts/application 142020-02-18T15:37:39.853687+00:00 app[web.1]: I, [2020-02-18T15:37:39.853566 #4] INFO -- : [907d8b82-df4f-443f-9bd5-82aa33f550eb] Rendered devise/shared/_links.html.erb (1.9ms) 152020-02-18T15:37:39.853823+00:00 app[web.1]: I, [2020-02-18T15:37:39.853733 #4] INFO -- : [907d8b82-df4f-443f-9bd5-82aa33f550eb] Rendered devise/sessions/new.html.erb within layouts/application (7.1ms) 162020-02-18T15:37:39.855747+00:00 app[web.1]: I, [2020-02-18T15:37:39.855660 #4] INFO -- : [907d8b82-df4f-443f-9bd5-82aa33f550eb] Completed 200 OK in 113ms (Views: 14.7ms | ActiveRecord: 29.6ms) 172020-02-18T15:37:39.858248+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=afeaer.herokuapp.com request_id=907d8b82-df4f-443f-9bd5-82aa33f550eb fwd="106.154.133.70" dyno=web.1 connect=0ms service=117ms status=200 bytes=4789 protocol=https 182020-02-18T15:37:40.219366+00:00 app[web.1]: I, [2020-02-18T15:37:40.219207 #4] INFO -- : [b633c1db-77cc-458c-9b50-06610a3e5222] Started GET "/assets/tempusdominus-bootstrap-4.css" for 106.154.133.70 at 2020-02-18 15:37:40 +0000 192020-02-18T15:37:41.598690+00:00 heroku[router]: at=info method=GET path="/assets/tempusdominus-bootstrap-4.css" host=afeaer.herokuapp.com request_id=b633c1db-77cc-458c-9b50-06610a3e5222 fwd="106.154.133.70" dyno=web.1 connect=5ms service=1383ms status=304 bytes=322 protocol=https 202020-02-18T15:37:42.565298+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=afeaer.herokuapp.com request_id=b0c02fcc-35b6-4403-bcbc-f06814cbae18 fwd="106.154.133.70" dyno=web.1 connect=0ms service=4ms status=200 bytes=207 protocol=https 212020-02-18T15:37:53.540284+00:00 heroku[router]: at=info method=GET path="/users/confirmation/new" host=afeaer.herokuapp.com request_id=9b04de8f-214e-49db-be6b-97f3a45d9b3c fwd="106.154.133.70" dyno=web.1 connect=0ms service=19ms status=200 bytes=3907 protocol=https 222020-02-18T15:37:53.524306+00:00 app[web.1]: I, [2020-02-18T15:37:53.524162 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Started GET "/users/confirmation/new" for 106.154.133.70 at 2020-02-18 15:37:53 +0000 232020-02-18T15:37:53.525921+00:00 app[web.1]: I, [2020-02-18T15:37:53.525806 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Processing by Devise::ConfirmationsController#new as HTML 242020-02-18T15:37:53.530906+00:00 app[web.1]: I, [2020-02-18T15:37:53.530760 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Rendering devise/confirmations/new.html.erb within layouts/application 252020-02-18T15:37:53.534261+00:00 app[web.1]: I, [2020-02-18T15:37:53.534156 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Rendered devise/shared/_error_messages.html.erb (0.6ms) 262020-02-18T15:37:53.537295+00:00 app[web.1]: I, [2020-02-18T15:37:53.537195 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Rendered devise/shared/_links.html.erb (1.3ms) 272020-02-18T15:37:53.537407+00:00 app[web.1]: I, [2020-02-18T15:37:53.537336 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Rendered devise/confirmations/new.html.erb within layouts/application (6.4ms) 282020-02-18T15:37:53.538690+00:00 app[web.1]: I, [2020-02-18T15:37:53.538595 #4] INFO -- : [9b04de8f-214e-49db-be6b-97f3a45d9b3c] Completed 200 OK in 13ms (Views: 10.7ms | ActiveRecord: 0.0ms) 292020-02-18T15:37:56.683697+00:00 app[web.1]: I, [2020-02-18T15:37:56.683492 #4] INFO -- : [d96cd399-20e0-4cf9-92ad-89bd69ecadeb] Started POST "/users/confirmation" for 106.154.133.70 at 2020-02-18 15:37:56 +0000 302020-02-18T15:37:56.685470+00:00 app[web.1]: I, [2020-02-18T15:37:56.685343 #4] INFO -- : [d96cd399-20e0-4cf9-92ad-89bd69ecadeb] Processing by Devise::ConfirmationsController#create as HTML 312020-02-18T15:37:56.685610+00:00 app[web.1]: I, [2020-02-18T15:37:56.685530 #4] INFO -- : [d96cd399-20e0-4cf9-92ad-89bd69ecadeb] Parameters: {"utf8"=>"✓", "authenticity_token"=>"Y3j/YN7MvYmmrlWxmqjZiqUS6aNF/V4HVosizsGatjx1F0wyi/01Reof0GtQzfY9WL8OS/TENsC2oRx8b2sE9Q==", "user"=>{"email"=>"quieenyukiya@gmail.com"}, "commit"=>"Resend confirmation instructions"}
申し訳ないのですが、自分ではエラーの内容がわかりません。解決策のご教授の方よろしくお願い申し上げます。
あなたの回答
tips
プレビュー