Rails服务两次页面

时间:2013-12-21 08:43:26

标签: ruby-on-rails

遇到一个错误的错误,其中rails 4为两页提供服务。

尝试了解决方案

  • here但没有骰子
  • 资产未预先编译,因此没有冲突。

我很难过。知道可能会发生什么吗?

以下是服务器日志。开发和生产模式也遇到同样的问题。

Started GET "/" for 127.0.0.1 at 2013-12-21 16:29:23 +0800
Started GET "/" for 127.0.0.1 at 2013-12-21 16:29:23 +0800
Processing by StaticPagesController#home as HTML
Processing by StaticPagesController#home as HTML
  Rendered static_pages/home.html.erb within layouts/application (0.2ms)
  Rendered static_pages/home.html.erb within layouts/application (0.2ms)
DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__drawer_html_erb__3283824921749738462_70245236444620 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_drawer.html.erb:3)
DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__drawer_html_erb__3283824921749738462_70245236444620 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_drawer.html.erb:3)
  Rendered layouts/_drawer.html.erb (75.9ms)
  Rendered layouts/_drawer.html.erb (75.9ms)
DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__header_html_erb__2675263796791980695_70245236072180 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_header.html.erb:27)
DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1. We recommend using Unobtrusive JavaScript instead. See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript. (called from _app_views_layouts__header_html_erb__2675263796791980695_70245236072180 at /Users/macintosh/rails_projects/moneybaby/app/views/layouts/_header.html.erb:27)
  Rendered layouts/_header.html.erb (1.5ms)
  Rendered layouts/_header.html.erb (1.5ms)
  Rendered layouts/_footer.html.erb (0.4ms)
  Rendered layouts/_footer.html.erb (0.4ms)
Completed 200 OK in 108ms (Views: 107.1ms | ActiveRecord: 0.0ms)
Completed 200 OK in 108ms (Views: 107.1ms | ActiveRecord: 0.0ms)  

Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:23 +0800
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:23 +0800 

Started GET "/assets/foundation_and_overrides.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation_and_overrides.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800  

Started GET "/assets/header_and_footer.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/header_and_footer.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/layout.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/layout.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/life_insurances.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/life_insurances.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/static_pages.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/static_pages.css?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.abide.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.abide.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/vendor/modernizr.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/vendor/modernizr.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.accordion.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.accordion.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.clearing.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.clearing.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.dropdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.dropdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.interchange.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.interchange.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/logoblue.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/logoblue.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.alert.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.alert.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/logodark.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/logodark.png" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.tab.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.tab.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.orbit.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.orbit.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.offcanvas.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.offcanvas.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.magellan.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.magellan.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.joyride.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.joyride.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.reveal.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.reveal.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800


Started GET "/assets/foundation/foundation.tooltip.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.tooltip.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/foundation/foundation.topbar.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/foundation/foundation.topbar.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/life_insurances.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/life_insurances.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/static_pages.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/static_pages.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/zepto_slideupdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/zepto_slideupdown.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-12-21 16:29:24 +0800

1 个答案:

答案 0 :(得分:1)

原来这是rails STDOUT日志记录的一个问题。

有关详细信息,请参阅以下链接:

Exact problem I'm having

Issue tracked here

我只是意识到使用Chrome分析时间线时页面没有被服务两次。资产只加载一次。推断它是记录器。谷歌搜索“rails logs两次”,现在我去了酒吧。