Rails应用程序在heroku日志中显示内存状态

问题描述 投票:0回答:1

我在heroku上的Rails应用程序上签名,并在我的heroku日志中收到以下错误。同时,用户已保存到数据库。

有人建议如何进行请。我正在使用devise gem,尝试了Puma和Thin服务器。仍然会出现相同的错误。应用程序位置在:https://naijasinglesmeet.herokuapp.com

注册一个帐户,这就是我在下面的日志中看到的内容:

请告知

2019-10-08T19:55:38.458871+00:00 app[web.1]: I, [2019-10-08T19:55:26.203972 #4]  INFO -- : [41600c35-8749-48f2-9c8a-8428f4a92dea] Completed 200 OK in 10ms (Views: 7.5ms | ActiveRecord: 0.0ms)
2019-10-08T19:55:38.458873+00:00 app[web.1]: I, [2019-10-08T19:55:38.298348 #4]  INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Started POST "/users" for 41.217.104.185 at 2019-10-08 19:55:38 +0000
2019-10-08T19:55:38.458875+00:00 app[web.1]: I, [2019-10-08T19:55:38.299628 #4]  INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Processing by RegistrationsController#create as HTML
2019-10-08T19:55:38.45889+00:00 app[web.1]: I, [2019-10-08T19:55:38.299753 #4]  INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"amK9Wje7yZ2DJDtylpzVrY9HrYgc7pmtBMnbl/lrdU5/dW+A00CGgDAW8uAtyfiUDF0tvSZtCt56gOeZsmO+mA==", "user"=>{"username"=>"iamyinka", "first_name"=>"Yinka", "last_name"=>"Ash", "email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2019-10-08T19:55:38.458892+00:00 app[web.1]: D, [2019-10-08T19:55:38.458466 #4] DEBUG -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]    (0.7ms)  BEGIN
2019-10-08T19:55:38.993261+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=naijasinglesmeet.herokuapp.com request_id=6561ef3b-42df-48a4-a227-6d9aa163b5c9 fwd="41.217.104.185" dyno=web.1 connect=0ms service=1ms status=304 bytes=62 protocol=https
2019-10-08T19:55:41.320556+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.02
2019-10-08T19:55:41.348659+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.79MB sample#memory_rss=79.75MB sample#memory_cache=0.04MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8805pages sample#memory_quota=512.00MB
2019-10-08T19:56:02.581435+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.01
2019-10-08T19:56:02.606547+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.76MB sample#memory_rss=79.75MB sample#memory_cache=0.01MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8813pages sample#memory_quota=512.00MB
2019-10-08T19:56:22.544894+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.01
2019-10-08T19:56:22.576747+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.76MB sample#memory_rss=79.75MB sample#memory_cache=0.01MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8813pages sample#memory_quota=512.00MB
2019-10-08T19:56:43.65213+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.01 sample#load_avg_5m=0.03
2019-10-08T19:56:43.68744+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.76MB sample#memory_rss=79.75MB sample#memory_cache=0.01MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8813pages sample#memory_quota=512.00MB


嗨,大家好。...这是一个更新...终于,我看到了一些事情...

2019-10-08T20:25:08.263845+00:00 app[web.1]: D, [2019-10-08T19:55:38.481415 #4] DEBUG -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]    (1.9ms)  COMMIT
2019-10-08T20:25:08.263848+00:00 app[web.1]: I, [2019-10-08T19:55:38.492062 #4]  INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]   Rendering devise/mailer/confirmation_instructions.html.erb
2019-10-08T20:25:08.26385+00:00 app[web.1]: I, [2019-10-08T19:55:38.494157 #4]  INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]   Rendered devise/mailer/confirmation_instructions.html.erb (2.0ms)
2019-10-08T20:25:08.263853+00:00 app[web.1]: D, [2019-10-08T19:55:38.494327 #4] DEBUG -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Devise::Mailer#confirmation_instructions: processed outbound mail in 12.1ms
2019-10-08T20:25:08.263855+00:00 app[web.1]: I, [2019-10-08T19:55:38.494606 #4]  INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Completed 500 Internal Server Error in 195ms (ActiveRecord: 14.8ms)
2019-10-08T20:25:08.263857+00:00 app[web.1]: F, [2019-10-08T19:55:38.496369 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]
2019-10-08T20:25:08.26386+00:00 app[web.1]: F, [2019-10-08T19:55:38.496444 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):
2019-10-08T20:25:08.263862+00:00 app[web.1]: F, [2019-10-08T19:55:38.496669 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]     2:
2019-10-08T20:25:08.263864+00:00 app[web.1]: [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]     3: <p>You can confirm your account email through the link below:</p>
2019-10-08T20:25:08.263866+00:00 app[web.1]: [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]     4:
2019-10-08T20:25:08.263867+00:00 app[web.1]: [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]     5: <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
2019-10-08T20:25:08.263869+00:00 app[web.1]: F, [2019-10-08T19:55:38.496775 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]
2019-10-08T20:25:08.26387+00:00 app[web.1]: F, [2019-10-08T19:55:38.496845 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] app/views/devise/mailer/confirmation_instructions.html.erb:5:in `_app_views_devise_mailer_confirmation_instructions_html_erb__3272380372352870108_47027054750980'
ruby-on-rails ruby heroku devise puma
1个回答
0
投票

错误消息的相关部分如下:

[2019-10-08T19:55:38.492062 #4] Rendering devise/mailer/confirmation_instructions.html.erb
[2019-10-08T19:55:38.496444 #4] FATAL -- :ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):

所以您的邮件发送模板正在尝试呈现,但是抛出ActionView::Template::Error并实际上告诉您问题所在:

Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true)

因此,您在电子邮件中使用了link_to,为了创建完整的URL,当然必须知道主机名。因此,您需要在某个位置定义该主机名。

例如,您可以通过包含在config/environments/production.rb中进行设置

config.action_controller.default_url_options = {:host => "naijasinglesmeet.herokuapp.com"}

这是因为您的应用程序不知道它在哪个主机/域上运行,所以必须告诉它。

一个小技巧,如果遇到此类问题,请运行heroku logs --tail,这将为您提供连续的日志,就像您在使用开发服务器一样。

© www.soinside.com 2019 - 2024. All rights reserved.