質問編集履歴

1

本番環境のエラー

2020/09/12 08:55

投稿

athlaliel
athlaliel

スコア7

test CHANGED
@@ -1 +1 @@
1
- デプロイしたら、本番環境でRailsアプリが開けなくなりました。
1
+ (修正)デプロイしたら、本番環境でRailsアプリが開けなくなりました。
test CHANGED
@@ -38,155 +38,39 @@
38
38
 
39
39
  **ローカルでアプリは動いても本番では動かない事や、このエラー自体はよくあるようなのでググりました。
40
40
 
41
- そして、自分のアプリのログをチェックしなさいと怒られているので、ローカルアプリのlog/development.logファイル最新ログをチェックしてみました。**
41
+ そして、自分のアプリのログをチェックしなさいと怒られているので、EC2にグインしてcat production.logで本番環境のログをチェックしました。**
42
42
 
43
43
 
44
44
 
45
-
46
-
47
-
48
-
49
- ### 該当のソースコード
50
-
51
-
52
-
53
-
54
-
55
- **log/development.logファイル内の直近ログ**
56
-
57
- ```
58
-
59
- Started GET "/users/4" for ::1 at 2020-09-12 15:31:05 +0900
60
-
61
- Processing by UsersController#show as HTML
62
-
63
- Parameters: {"id"=>"4"}
64
-
65
- User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 4 LIMIT 1
66
-
67
- ↳ app/controllers/users_controller.rb:4:in `show'
68
-
69
- Rendering users/show.html.erb within layouts/application
70
-
71
- Tweet Load (0.3ms) SELECT `tweets`.* FROM `tweets` WHERE `tweets`.`user_id` = 4
72
-
73
- ↳ app/views/users/show.html.erb:3
74
-
75
- User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 4 ORDER BY `users`.`id` ASC LIMIT 1
76
-
77
- ↳ app/views/tweets/_tweet.html.erb:8
78
-
79
- Rendered tweets/_tweet.html.erb (Duration: 4.3ms | Allocations: 1796)
80
-
81
- Rendered users/show.html.erb within layouts/application (Duration: 6.4ms | Allocations: 3197)
82
-
83
- Completed 200 OK in 19ms (Views: 16.9ms | ActiveRecord: 0.9ms | Allocations: 18609)
84
-
85
-
86
-
87
-
88
-
89
- DEPRECATION WARNING: #fog_provider is deprecated and has no effect (called from block in <main> at /Users/athlaliel/test/panlove/config/initializers/carrierwave.rb:7)
90
-
91
- DEPRECATION WARNING: #fog_provider is deprecated and has no effect (called from block in <main> at /Users/athlaliel/test/panlove/config/initializers/carrierwave.rb:7)
92
-
93
- DEPRECATION WARNING: #fog_provider is deprecated and has no effect (called from block in <main> at /Users/athlaliel/test/panlove/config/initializers/carrierwave.rb:7)
94
-
95
- DEPRECATION WARNING: #fog_provider is deprecated and has no effect (called from block in <main> at /Users/athlaliel/test/panlove/config/initializers/carrierwave.rb:7)
96
-
97
- DEPRECATION WARNING: #fog_provider is deprecated and has no effect (called from block in <main> at /Users/athlaliel/test/panlove/config/initializers/carrierwave.rb:7)
98
-
99
- Started GET "/" for ::1 at 2020-09-12 15:36:50 +0900
100
-
101
-  (4.9ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
102
-
103
-  (0.3ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
104
-
105
- Processing by TweetsController#index as HTML
106
-
107
- Rendering tweets/index.html.erb within layouts/application
108
-
109
- Tweet Load (4.0ms) SELECT `tweets`.* FROM `tweets` ORDER BY created_at DESC LIMIT 3 OFFSET 0
110
-
111
- ↳ app/views/tweets/index.html.erb:16
112
-
113
- User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` IN (4, 2)
114
-
115
- ↳ app/views/tweets/index.html.erb:16
116
-
117
- User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 4 ORDER BY `users`.`id` ASC LIMIT 1
118
-
119
- ↳ app/views/tweets/_tweet.html.erb:8
120
-
121
- Rendered tweets/_tweet.html.erb (Duration: 6.9ms | Allocations: 2088)
122
-
123
- Rendered tweets/_tweet.html.erb (Duration: 0.6ms | Allocations: 384)
124
-
125
- Rendered tweets/_tweet.html.erb (Duration: 0.4ms | Allocations: 382)
126
-
127
-  (0.3ms) SELECT COUNT(*) FROM `tweets`
128
-
129
- ↳ app/views/tweets/index.html.erb:23
130
-
131
- Rendered tweets/_footer.html.erb (Duration: 3.1ms | Allocations: 625)
132
-
133
- Rendered tweets/index.html.erb within layouts/application (Duration: 1745.8ms | Allocations: 1627315)
134
-
135
- Completed 200 OK in 1828ms (Views: 1769.9ms | ActiveRecord: 26.7ms | Allocations: 1651538)
136
-
137
-
138
-
139
-
140
-
141
- Started DELETE "/users/sign_out" for ::1 at 2020-09-12 15:36:56 +0900
142
-
143
- Processing by Devise::SessionsController#destroy as HTML
144
-
145
- Parameters: {"authenticity_token"=>"<トークンは非表示にしています>=="}
146
-
147
- User Load (0.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 4 ORDER BY `users`.`id` ASC LIMIT 1
148
-
149
- Redirected to http://localhost:3000/
150
-
151
- Completed 302 Found in 7ms (ActiveRecord: 0.2ms | Allocations: 4010)
152
-
153
-
154
-
155
-
156
-
157
- Started GET "/" for ::1 at 2020-09-12 15:36:56 +0900
158
-
159
- Processing by TweetsController#index as HTML
160
-
161
- Rendering tweets/index.html.erb within layouts/application
162
-
163
- Tweet Load (0.2ms) SELECT `tweets`.* FROM `tweets` ORDER BY created_at DESC LIMIT 3 OFFSET 0
164
-
165
- ↳ app/views/tweets/index.html.erb:16
166
-
167
- User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` IN (4, 2)
168
-
169
- ↳ app/views/tweets/index.html.erb:16
170
-
171
- Rendered tweets/_tweet.html.erb (Duration: 2.4ms | Allocations: 737)
172
-
173
- Rendered tweets/_tweet.html.erb (Duration: 0.3ms | Allocations: 415)
174
-
175
- Rendered tweets/_tweet.html.erb (Duration: 0.7ms | Allocations: 413)
176
-
177
-  (0.2ms) SELECT COUNT(*) FROM `tweets`
178
-
179
- ↳ app/views/tweets/index.html.erb:23
180
-
181
- Rendered tweets/_footer.html.erb (Duration: 0.6ms | Allocations: 512)
182
-
183
- Rendered tweets/index.html.erb within layouts/application (Duration: 13.3ms | Allocations: 8572)
184
-
185
- Completed 200 OK in 38ms (Views: 36.3ms | ActiveRecord: 0.7ms | Allocations: 23542)
45
+ ### エラー内容抜粋
186
46
 
187
47
 
188
48
 
189
49
  ```
50
+
51
+ ActionController::RoutingError (No route matches [GET] "/TP/html/public/index.php"):
52
+
53
+
54
+
55
+ Rendered tweets/index.html.erb within layouts/application (Duration: 10.5ms | Allocations: 4817)
56
+
57
+
58
+
59
+ Completed 500 Internal Server Error in 12ms (ActiveRecord: 0.6ms | Allocations: 5296)
60
+
61
+
62
+
63
+ ActionView::Template::Error (undefined method `breadcrumb' for #<#<Class:0x00000000076186e8>:0x0000000006cdd218>):
64
+
65
+
66
+
67
+ ```
68
+
69
+
70
+
71
+ **このようなエラーが発生していることが本番環境で分かりました。しかし、エラーの原因の内容が不明で、現在エラー文の内容を調べている最中です。**
72
+
73
+
190
74
 
191
75
 
192
76
 
@@ -200,19 +84,11 @@
200
84
 
201
85
 
202
86
 
203
- ログの末尾は**Completed 200 OK**となっているのでサーバーエラー等起きていないと思います。
204
-
205
- また他に同じエラー起きた方はその上のRenderedに原因があるとありますが、それらしい文言には見えません。
206
-
207
-
208
-
209
87
  一連の作業をする前に**rails db:migrate**を行った後に、一旦作業をやめる為に**rails db:rollback**を行っています。
210
88
 
211
89
 
212
90
 
213
- もしや、それがまずかったのかと考えていますが、具体的な解決策が現状浮かんでおりません。
91
+ もしや、それがまずかったのかと考えていますが、本番環境で何を直せば良いのか具体的な解決策が現状浮かんでおりません。
214
-
215
- ローカルで動いているのに本番環境で開かないエラー原因が解明で機内でいます。
216
92
 
217
93
 
218
94