Rails 应用程序在 heroku 日志中显示内存统计信息



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

任何对如何进行提出建议的人请。我正在使用设计宝石,尝试了彪马和瘦服务器。仍然得到相同的错误。应用位置为: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"=>"iamhere@yinka.com", "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'

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

[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,这将为您提供连续的日志,就像您使用开发服务器一样。

最新更新