为什么我的Rails会说两次?

时间:2014-08-19 14:41:10

标签: macos ruby-on-rails-4 terminal

在终端中,我的rails服务器说了两次。例如 -

Started GET "/" for 127.0.0.1 at 2014-08-19 15:31:00 +0100
Started GET "/" for 127.0.0.1 at 2014-08-19 15:31:00 +0100
  ActiveRecord::SchemaMigration Load (0.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"
  ActiveRecord::SchemaMigration Load (0.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by BlogsController#show as HTML
Processing by BlogsController#show as HTML
  User Load (0.7ms)  SELECT  "users".* FROM "users"  WHERE "users"."id" = 1  ORDER BY "users"."id" ASC LIMIT 1
  User Load (0.7ms)  SELECT  "users".* FROM "users"  WHERE "users"."id" = 1  ORDER BY "users"."id" ASC LIMIT 1
  Blog Load (0.3ms)  SELECT  "blogs".* FROM "blogs"   ORDER BY "blogs"."id" DESC LIMIT 1
  Blog Load (0.3ms)  SELECT  "blogs".* FROM "blogs"   ORDER BY "blogs"."id" DESC LIMIT 1
  Rendered blogs/show.html.erb within layouts/application (5.0ms)
  Rendered blogs/show.html.erb within layouts/application (5.0ms)
  Rendered layouts/_navbar.html.erb (0.7ms)
  Rendered layouts/_navbar.html.erb (0.7ms)
  Rendered layouts/_banner.html.erb (2.9ms)
  Rendered layouts/_banner.html.erb (2.9ms)
Completed 200 OK in 87ms (Views: 44.2ms | ActiveRecord: 3.7ms)
Completed 200 OK in 87ms (Views: 44.2ms | ActiveRecord: 3.7ms)

一切似乎都运转正常,但......很奇怪,不是吗?为什么是这样?它发生在mac终端和iTerm中。

1 个答案:

答案 0 :(得分:0)

在你问之前,你找到了答案吗?以下是提供快速Google搜索的一些解决方案之一:

Rails Logger appears to be duplicating log lines