質問編集履歴

1

内容を編集しました。

2024/04/04 14:01

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -14,36 +14,51 @@
14
14
  特定のページに行くと下写真が表示されます。
15
15
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2024-04-04/37dd0f1b-cfb8-40a2-b348-756e5ebc97e7.png)
16
16
 
17
- ログの内容です
17
+ ログの内容更新しました
18
18
  ```
19
- [ec2-user@ip-(プライベートIP) *]$ sudo tail -f log/production.log
19
+ [ec2-user@ip-172-31-12-75 inugo]$ sudo tail -f log/production.log
20
+ [cd036ade-25f6-4fd1-a83b-78f41a15569e]
21
+ I, [2024-04-04T13:29:47.676781 #8398] INFO -- : [b4a92c44-5c12-4a6e-bb88-03685c4236da] Started GET "/node/kor/113/main" for 87.246.7.86 at 2024-04-04 13:29:47 +0000
22
+ F, [2024-04-04T13:29:47.677283 #8398] FATAL -- : [b4a92c44-5c12-4a6e-bb88-03685c4236da]
23
+ [b4a92c44-5c12-4a6e-bb88-03685c4236da] ActionController::RoutingError (No route matches [GET] "/node/kor/113/main"):
24
+ [b4a92c44-5c12-4a6e-bb88-03685c4236da]
25
+ I, [2024-04-04T13:42:01.034595 #8398] INFO -- : [3d70abee-76af-4431-81f2-7876531099a8] Started GET "/" for 193.3.23.126 at 2024-04-04 13:42:01 +0000
26
+ I, [2024-04-04T13:42:01.035322 #8398] INFO -- : [3d70abee-76af-4431-81f2-7876531099a8] Processing by User::HomesController#top as HTML
27
+ I, [2024-04-04T13:42:01.035929 #8398] INFO -- : [3d70abee-76af-4431-81f2-7876531099a8] Rendered user/homes/top.html.erb within layouts/application (Duration: 0.0ms | Allocations: 4)
28
+ I, [2024-04-04T13:42:01.037546 #8398] INFO -- : [3d70abee-76af-4431-81f2-7876531099a8] Rendered layout layouts/application.html.erb (Duration: 1.7ms | Allocations: 908)
29
+ I, [2024-04-04T13:42:01.037733 #8398] INFO -- : [3d70abee-76af-4431-81f2-7876531099a8] Completed 200 OK in 2ms (Views: 2.0ms | Allocations: 1212)
30
+ I, [2024-04-04T13:51:24.250612 #8398] INFO -- : [a4507957-060f-4fdf-a356-013417cdbf7b] Started GET "/users/sign_in" for 14.11.8.34 at 2024-04-04 13:51:24 +0000
31
+ I, [2024-04-04T13:51:24.251385 #8398] INFO -- : [a4507957-060f-4fdf-a356-013417cdbf7b] Processing by User::SessionsController#new as HTML
32
+ I, [2024-04-04T13:51:24.253149 #8398] INFO -- : [a4507957-060f-4fdf-a356-013417cdbf7b] Rendered user/sessions/new.html.erb within layouts/application (Duration: 0.6ms | Allocations: 384)
33
+ I, [2024-04-04T13:51:24.254614 #8398] INFO -- : [a4507957-060f-4fdf-a356-013417cdbf7b] Rendered layout layouts/application.html.erb (Duration: 2.1ms | Allocations: 1240)
34
+ I, [2024-04-04T13:51:24.254791 #8398] INFO -- : [a4507957-060f-4fdf-a356-013417cdbf7b] Completed 200 OK in 3ms (Views: 2.5ms | Allocations: 1867)
20
- I, [2024-04-04T10:41:18.797070 #8398] INFO -- : [7fbe208d-4653-4e15-afd5-a8b9d313d482] Started GET "/shops/accommodation" for 14.11.8.34 at 2024-04-04 10:41:18 +0000
35
+ I, [2024-04-04T13:51:25.756831 #8398] INFO -- : [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52] Started GET "/shops/accommodation" for 14.11.8.34 at 2024-04-04 13:51:25 +0000
21
- I, [2024-04-04T10:41:18.797929 #8398] INFO -- : [7fbe208d-4653-4e15-afd5-a8b9d313d482] Processing by User::ShopsController#accommodation as HTML
36
+ I, [2024-04-04T13:51:25.757571 #8398] INFO -- : [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52] Processing by User::ShopsController#accommodation as HTML
22
- I, [2024-04-04T10:41:18.801234 #8398] INFO -- : [7fbe208d-4653-4e15-afd5-a8b9d313d482] Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.6ms | Allocations: 1095)
37
+ I, [2024-04-04T13:51:25.765147 #8398] INFO -- : [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52] Completed 500 Internal Server Error in 7ms (ActiveRecord: 1.0ms | Allocations: 1136)
23
- F, [2024-04-04T10:41:18.801811 #8398] FATAL -- : [7fbe208d-4653-4e15-afd5-a8b9d313d482]
38
+ F, [2024-04-04T13:51:25.765816 #8398] FATAL -- : [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52]
24
- [7fbe208d-4653-4e15-afd5-a8b9d313d482] NoMethodError (undefined method `shops' for nil:NilClass
39
+ [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52] NoMethodError (undefined method `shops' for nil:NilClass
25
40
 
26
41
  @shops = target_genre.shops
27
42
  ^^^^^^):
28
- [7fbe208d-4653-4e15-afd5-a8b9d313d482]
43
+ [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52]
29
- [7fbe208d-4653-4e15-afd5-a8b9d313d482] app/controllers/user/shops_controller.rb:5:in `accommodation'
44
+ [2e81664e-e4ca-4161-91d5-6ebd2f0cbe52] app/controllers/user/shops_controller.rb:5:in `accommodation'
30
- I, [2024-04-04T10:58:41.324189 #8398] INFO -- : [cf206835-1d8c-40ca-acb5-aa272657960f] Started GET "/.env" for 20.83.145.120 at 2024-04-04 10:58:41 +0000
45
+ I, [2024-04-04T13:51:27.628818 #8398] INFO -- : [84cdd216-809e-43c6-86a9-4ebefc52e6c9] Started GET "/shops/shopping_mall" for 14.11.8.34 at 2024-04-04 13:51:27 +0000
31
- F, [2024-04-04T10:58:41.325257 #8398] FATAL -- : [cf206835-1d8c-40ca-acb5-aa272657960f]
46
+ I, [2024-04-04T13:51:27.629557 #8398] INFO -- : [84cdd216-809e-43c6-86a9-4ebefc52e6c9] Processing by User::ShopsController#shopping_mall as HTML
32
- [cf206835-1d8c-40ca-acb5-aa272657960f] ActionController::RoutingError (No route matches [GET] "/.env"):
33
- [cf206835-1d8c-40ca-acb5-aa272657960f]
34
- I, [2024-04-04T10:58:41.690673 #8398] INFO -- : [423b41eb-472c-4a4e-a26b-574b9a1e082c] Started POST "/" for 20.83.145.120 at 2024-04-04 10:58:41 +0000
47
+ I, [2024-04-04T13:51:27.632454 #8398] INFO -- : [84cdd216-809e-43c6-86a9-4ebefc52e6c9] Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.6ms | Allocations: 1037)
35
- F, [2024-04-04T10:58:41.691331 #8398] FATAL -- : [423b41eb-472c-4a4e-a26b-574b9a1e082c]
48
+ F, [2024-04-04T13:51:27.633118 #8398] FATAL -- : [84cdd216-809e-43c6-86a9-4ebefc52e6c9]
36
- [423b41eb-472c-4a4e-a26b-574b9a1e082c] ActionController::RoutingError (No route matches [POST] "/"):
37
- [423b41eb-472c-4a4e-a26b-574b9a1e082c]
38
- I, [2024-04-04T11:03:52.378342 #8398] INFO -- : [f4843e47-3668-42b4-9923-fac71aa83979] Started GET "/.env" for 185.254.196.186 at 2024-04-04 11:03:52 +0000
39
- F, [2024-04-04T11:03:52.379013 #8398] FATAL -- : [f4843e47-3668-42b4-9923-fac71aa83979]
40
- [f4843e47-3668-42b4-9923-fac71aa83979] ActionController::RoutingError (No route matches [GET] "/.env"):
49
+ [84cdd216-809e-43c6-86a9-4ebefc52e6c9] NoMethodError (undefined method `shops' for nil:NilClass
50
+
41
- [f4843e47-3668-42b4-9923-fac71aa83979]
51
+ @shops = target_genre.shops
42
- I, [2024-04-04T11:03:53.076519 #8398] INFO -- : [f53f32f5-bf05-4170-b8b0-d125f2573f3d] Started POST "/" for 185.254.196.186 at 2024-04-04 11:03:53 +0000
43
- F, [2024-04-04T11:03:53.076952 #8398] FATAL -- : [f53f32f5-bf05-4170-b8b0-d125f2573f3d]
52
+ ^^^^^^):
44
- [f53f32f5-bf05-4170-b8b0-d125f2573f3d] ActionController::RoutingError (No route matches [POST] "/"):
45
- [f53f32f5-bf05-4170-b8b0-d125f2573f3d]
53
+ [84cdd216-809e-43c6-86a9-4ebefc52e6c9]
54
+ [84cdd216-809e-43c6-86a9-4ebefc52e6c9] app/controllers/user/shops_controller.rb:11:in `shopping_mall'
55
+
46
56
 
47
57
  ```
58
+ 上記を見るに、
59
+ ・ActionControllerルーティングエラーが/node/kor/113/mainにでている
60
+ ・accommodationとshopping_mallのshops_controller.rbにあるshopsがnilだということ
61
+ が主な原因だと思うのですが、
62
+ ローカル(rails s)では問題なく表示されており、rails c でデータが入っているか確認しましたら、しっかり入っていました。
48
63
 
49
64