在142ms完成500内部服务器错误(视图:9.8ms | ActiveRecord:34.6ms)

时间:2014-04-07 17:14:21

标签: ruby-on-rails ruby-on-rails-3 heroku ruby-on-rails-4

所以,我有一个应用程序,允许用户创建事件和活动,其他人可以查看它们(在显示页面中),如果他们愿意,可以参加。

现在问题是,我可以点击一个事件,弹出事件#show页面,一切都很棒,顺便说一下,活动页面没有打开,我收到404错误。

当检查heroku日志,并且开发控制台登录开发时我没有看到任何可见的错误,我看到的唯一错误是:

 Completed 500 Internal Server Error in 142ms (Views: 9.8ms | ActiveRecord: 34.6ms)

这可能是什么?我已经多次查看代码并且没有任何明显的问题,而且它在开发中也有效我只能在生产中获得这个404.有什么想法吗?

更新:Heroku日志:

2014-04-07T17:08:57.651579+00:00 app[web.1]:   Parameters: {"id"=>"4"}
2014-04-07T17:08:57.651738+00:00 app[web.1]: Geokit is using the domain: *hidden*
2014-04-07T17:08:57.657087+00:00 app[web.1]:   User Load (3.8ms)  SELECT "users".* FROM "users" ORDER BY random() LIMIT 5
2014-04-07T17:08:57.663588+00:00 app[web.1]:   User Load (4.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 40 ORDER BY "users"."id" ASC LIMIT 1
2014-04-07T17:08:57.672547+00:00 app[web.1]:   Activity Load (7.7ms)  SELECT "activities".* FROM "activities" WHERE "activities"."id" = $1 LIMIT 1  [["id", "4"]]
2014-04-07T17:08:57.676877+00:00 app[web.1]:   User Load (2.8ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1  [["id", 38]]
2014-04-07T17:08:57.693696+00:00 app[web.1]:   Photo Load (1.3ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.697251+00:00 app[web.1]:   Ethnicity Load (1.0ms)  SELECT "ethnicities".* FROM "ethnicities" WHERE "ethnicities"."id" = $1 ORDER BY "ethnicities"."id" ASC LIMIT 1  [["id", 6]]
2014-04-07T17:08:57.699600+00:00 app[web.1]:   Education Load (1.5ms)  SELECT "educations".* FROM "educations" WHERE "educations"."id" = $1 ORDER BY "educations"."id" ASC LIMIT 1  [["id", 4]]
2014-04-07T17:08:57.710452+00:00 app[web.1]:   Question Load (9.6ms)  SELECT "questions".* FROM "questions" WHERE "questions"."user_id" = $1  [["user_id", 40]]
2014-04-07T17:08:57.712549+00:00 app[web.1]:   CACHE (0.0ms)  SELECT "photos".* FROM 
"photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.728908+00:00 app[web.1]:   CACHE (15.5ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.730101+00:00 app[web.1]:   CACHE (0.0ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.730981+00:00 app[web.1]:   CACHE (0.1ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.761039+00:00 app[web.1]:   Rendered layouts/_left_side.html.erb (72.0ms)
2014-04-07T17:08:57.731304+00:00 app[web.1]:   Rendered layouts/_profile_completion.html.erb (19.6ms)
2014-04-07T17:08:57.760362+00:00 app[web.1]:   Message Exists (3.4ms)  SELECT 1 AS one FROM "messages" WHERE "messages"."recipient_id" = $1 AND "messages"."is_new" = 't' LIMIT 1  [["recipient_id", 40]]
2014-04-07T17:08:57.786347+00:00 app[web.1]:   CACHE (0.1ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.782607+00:00 app[web.1]:    (1.6ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 4], ["commentable_type", "Activity"]]
2014-04-07T17:08:57.799144+00:00 app[web.1]:   CACHE (0.0ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 40], ["attachable_type", "User"]]
2014-04-07T17:08:57.818837+00:00 app[web.1]:   Rendered collection (0.0ms)
2014-04-07T17:08:57.833708+00:00 app[web.1]:   User Exists (5.2ms)  SELECT 1 AS one FROM "users" INNER JOIN "activity_participants" ON "users"."id" = "activity_participants"."user_id" WHERE "activity_participants"."activity_id" = $1 AND "users"."id" = 40 LIMIT 1  [["activity_id", 4]]
2014-04-07T17:08:57.840280+00:00 app[web.1]:   Photo Load (3.9ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 38], ["attachable_type", "User"]]
2014-04-07T17:08:57.818561+00:00 app[web.1]:   Comment Load (5.1ms)  SELECT "comments".* FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2 AND "comments"."parent_id" IS NULL  [["commentable_id", 4], ["commentable_type", "Activity"]]
2014-04-07T17:08:57.841447+00:00 app[web.1]:   CACHE (0.0ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 38], ["attachable_type", "User"]]
2014-04-07T17:08:57.858143+00:00 app[web.1]:    (5.4ms)  SELECT COUNT(*) FROM "users" INNER JOIN "activity_participants" ON "users"."id" = "activity_participants"."user_id" WHERE "activity_participants"."activity_id" = $1  [["activity_id", 4]]
2014-04-07T17:08:57.863920+00:00 app[web.1]:   CACHE (0.0ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 38], ["attachable_type", "User"]]
2014-04-07T17:08:57.861996+00:00 app[web.1]:   User Load (3.0ms)  SELECT "users".* FROM "users" INNER JOIN "activity_participants" ON "users"."id" = "activity_participants"."user_id" WHERE "activity_participants"."activity_id" = $1  [["activity_id", 4]]
2014-04-07T17:08:57.864761+00:00 app[web.1]:   CACHE (0.0ms)  SELECT "photos".* FROM "photos" WHERE "photos"."attachable_id" = $1 AND "photos"."attachable_type" = $2 AND "photos"."profile_photo" = 't' ORDER BY "photos"."id" ASC LIMIT 1  [["attachable_id", 38], ["attachable_type", "User"]]
2014-04-07T17:08:57.869745+00:00 app[web.1]:   Rendered activities/_activity_right_side.html.erb (45.4ms)
2014-04-07T17:08:57.869976+00:00 app[web.1]:   Rendered activities/show.html.erb within layouts/application (184.0ms)
2014-04-07T17:08:57.871758+00:00 app[web.1]:   Rendered errors/error_500.html.erb within layouts/application (0.5ms)
2014-04-07T17:08:57.875144+00:00 app[web.1]:   Event Load (1.5ms)  SELECT "events".* FROM "events" INNER JOIN "event_participants" ON "events"."id" = "event_participants"."event_id" WHERE "event_participants"."user_id" = $1  [["user_id", 40]]
2014-04-07T17:08:57.875788+00:00 app[web.1]:   Rendered layouts/_pusher.html.erb (3.1ms)
2014-04-07T17:08:57.880542+00:00 app[web.1]:   Notification Exists (1.1ms)  SELECT 1 AS one FROM "notifications" WHERE "notifications"."user_id" = $1 AND "notifications"."is_opened" = 'f' LIMIT 1  [["user_id", 40]]
2014-04-07T17:08:57.882166+00:00 app[web.1]:   CACHE (0.0ms)  SELECT 1 AS one FROM "notifications" WHERE "notifications"."user_id" = $1 AND "notifications"."is_opened" = 'f' LIMIT 1  [["user_id", 40]]
2014-04-07T17:08:57.891660+00:00 heroku[router]: at=info method=GET path=/activities/4 host=*hidden* request_id=f6f6ab0e-c627-482d-a49b-d7d351ba398a fwd="99.234.25.253" dyno=web.1 connect=9ms service=393ms status=500 bytes=10914
2014-04-07T17:08:57.884160+00:00 app[web.1]:   CACHE (0.0ms)  SELECT 1 AS one FROM "messages" WHERE "messages"."recipient_id" = $1 AND "messages"."is_new" = 't' LIMIT 1  [["recipient_id", 40]]
2014-04-07T17:08:57.883375+00:00 app[web.1]:   CACHE (0.0ms)  SELECT 1 AS one FROM "messages" WHERE "messages"."recipient_id" = $1 AND "messages"."is_new" = 't' LIMIT 1  [["recipient_id", 40]]
2014-04-07T17:08:57.884773+00:00 app[web.1]:   Rendered shared/_header.html.erb (8.2ms)
2014-04-07T17:08:57.885126+00:00 app[web.1]:   Rendered layouts/_flash.html.erb (0.1ms)
2014-04-07T17:08:57.885902+00:00 app[web.1]: Completed 500 Internal Server Error in 234ms (Views: 12.7ms | ActiveRecord: 81.1ms)
2014-04-07T17:08:57.885600+00:00 app[web.1]:   Rendered shared/_footer.html.erb (0.2ms)
2014-04-07T17:08:58.357410+00:00 heroku[router]: at=info method=GET path=/assets/logo-404-6d97dc33614d27e176e8344ea679813f.png host=www.friendiose.com request_id=d00190ed-d365-46aa-978d-53c0fed636f4 fwd="99.234.25.253" dyno=web.1 connect=3ms service=12ms status=200 bytes=30821
2014-04-07T17:09:04.078418+00:00 heroku[run.8642]: State changed from up to complete
2014-04-07T17:09:04.066492+00:00 heroku[run.8642]: Process exited with status 0
2014-04-07T17:08:56.083949+00:00 heroku[router]: at=info method=GET path=/assets/place_map_icon-eea0b812cae352793b07d4cc9ab29ab6.png host=www.friendiose.com request_id=288b92d3-46fc-4d3c-a6c2-edcb1746aa7b fwd="99.234.25.253" dyno=web.1 connect=15ms service=37ms status=200 bytes=3282
2014-04-07T17:08:55.818610+00:00 heroku[router]: at=info method=GET path=/assets/w_icon-b05939cd15957a224c909f4152f6de76.png host=www.friendiose.com request_id=8558679d-8b23-424a-b285-0a5756d637c9 fwd="99.234.25.253" dyno=web.1 connect=4ms service=9ms status=304 bytes=89
2014-04-07T17:10:45.276715+00:00 app[web.1]: I, [2014-04-07T17:10:45.276355 #2]  INFO -- : Started GET "/activities/4" for 99.234.25.253 at 2014-04-07 17:10:45 +0000
2014-04-07T17:10:45.276873+00:00 app[web.1]: I, [2014-04-07T17:10:45.276522 #2]  INFO -- : Started GET "/activities/4" for 99.234.25.253 at 2014-04-07 17:10:45 +0000

0 个答案:

没有答案