質問編集履歴

2

log内容が変わったので載せます。

2021/01/12 05:40

投稿

kai
kai

スコア92

test CHANGED
File without changes
test CHANGED
@@ -10,83 +10,9 @@
10
10
 
11
11
 
12
12
 
13
- サーバーに入ってproduction.logを確認したところ気になる点を見つけたので載せます。
13
+ log画像
14
14
 
15
- ```ruby
16
-
17
- D, [2021-01-11T02:52:35.012769 #15674] DEBUG -- : ESC[1mESC[35m (38.1ms)ESC[0m ESC[1mESC[35mSET 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 = 2147483ESC[0m
18
-
19
- D, [2021-01-11T02:52:35.057865 #15674] DEBUG -- : ESC[1mESC[35m (1.2ms)ESC[0m ESC[1mESC[35mSET 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 = 2147483ESC[0m
20
-
21
- D, [2021-01-11T02:52:35.059292 #15674] DEBUG -- : ESC[1mESC[35m (1.2ms)ESC[0m ESC[1mESC[34mSELECT GET_LOCK('561209816425572195', 0)ESC[0m
22
-
23
- D, [2021-01-11T02:52:35.082026 #15674] DEBUG -- : ESC[1mESC[35m (0.2ms)ESC[0m ESC[1mESC[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASCESC[0m
24
-
25
- D, [2021-01-11T02:52:35.086910 #15674] DEBUG -- : ESC[1mESC[36mActiveRecord::InternalMetadata Load (1.4ms)ESC[0m ESC[1mESC[34mSELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1ESC[0m
26
-
27
- D, [2021-01-11T02:52:35.092817 #15674] DEBUG -- : ESC[1mESC[35m (1.0ms)ESC[0m ESC[1mESC[34mSELECT RELEASE_LOCK('561209816425572195')ESC[0m
28
-
29
- D, [2021-01-11T02:52:38.634141 #15765] DEBUG -- : ESC[1mESC[35m (1.3ms)ESC[0m ESC[1mESC[35mSET 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 = 2147483ESC[0m
30
-
31
- I, [2021-01-11T02:52:49.475664 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Started GET "/" for 153.215.7.234 at 2021-01-11 02:52:49 +0000
32
-
33
- I, [2021-01-11T02:52:49.483309 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Processing by HomeController#index as HTML
34
-
35
- I, [2021-01-11T02:52:49.488423 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Rendering home/index.html.erb within layouts/application
36
-
37
- I, [2021-01-11T02:52:49.491052 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Rendered home/index.html.erb within layouts/application (Duration: 2.5ms | Allocations: 607)
38
-
39
- I, [2021-01-11T02:52:49.502723 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Rendered layouts/_header.html.erb (Duration: 4.0ms | Allocations: 766)
40
-
41
- I, [2021-01-11T02:52:49.503750 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Rendered layouts/_footer.html.erb (Duration: 0.6ms | Allocations: 85)
42
-
43
- I, [2021-01-11T02:52:49.504052 #15831] INFO -- : [7a9904f5-26fe-4dc3-83b5-25c03b284f79] Completed 200 OK in 21ms (Views: 18.2ms | Allocations: 6311)
44
-
45
- I, [2021-01-11T02:52:50.602750 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Started GET "/users/sign_up" for 153.215.7.234 at 2021-01-11 02:52:50 +0000
46
-
47
- I, [2021-01-11T02:52:50.610504 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Processing by Devise::RegistrationsController#new as HTML
48
-
49
- D, [2021-01-11T02:52:50.620083 #15830] DEBUG -- : [6e502137-0675-4745-8b24-c5a955264184] ESC[1mESC[35m (1.9ms)ESC[0m ESC[1mESC[35mSET 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 = 2147483ESC[0m
50
-
51
- I, [2021-01-11T02:52:50.650438 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Rendering devise/registrations/new.html.erb within layouts/application
52
-
53
- I, [2021-01-11T02:52:50.655546 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Rendered devise/shared/_error_messages.html.erb (Duration: 0.8ms | Allocations: 196)
54
-
55
- I, [2021-01-11T02:52:50.662057 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Rendered devise/shared/_links.html.erb (Duration: 1.8ms | Allocations: 637)
56
-
57
- I, [2021-01-11T02:52:50.662504 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Rendered devise/registrations/new.html.erb within layouts/application (Duration: 11.6ms | Allocations: 3734)
58
-
59
- I, [2021-01-11T02:52:50.672053 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Rendered layouts/_header.html.erb (Duration: 1.4ms | Allocations: 737)
60
-
61
- I, [2021-01-11T02:52:50.672703 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Rendered layouts/_footer.html.erb (Duration: 0.2ms | Allocations: 85)
62
-
63
- I, [2021-01-11T02:52:50.673084 #15830] INFO -- : [6e502137-0675-4745-8b24-c5a955264184] Completed 200 OK in 62ms (Views: 26.6ms | ActiveRecord: 9.9ms | Allocations: 18063)
64
-
65
- I, [2021-01-11T02:52:50.820520 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Started GET "/users/sign_up" for 153.215.7.234 at 2021-01-11 02:52:50 +0000
66
-
67
- I, [2021-01-11T02:52:50.822011 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Processing by Devise::RegistrationsController#new as HTML
68
-
69
- D, [2021-01-11T02:52:50.826043 #15831] DEBUG -- : [a019769f-7955-458b-aed4-af1fa8353e33] ESC[1mESC[35m (0.9ms)ESC[0m ESC[1mESC[35mSET 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 = 2147483ESC[0m
70
-
71
- I, [2021-01-11T02:52:50.863676 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Rendering devise/registrations/new.html.erb within layouts/application
72
-
73
- I, [2021-01-11T02:52:50.867264 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Rendered devise/shared/_error_messages.html.erb (Duration: 0.6ms | Allocations: 196)
74
-
75
- I, [2021-01-11T02:52:50.874626 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Rendered devise/shared/_links.html.erb (Duration: 1.9ms | Allocations: 632)
76
-
77
- I, [2021-01-11T02:52:50.874709 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Rendered devise/registrations/new.html.erb within layouts/application (Duration: 10.9ms | Allocations: 3681)
78
-
79
- I, [2021-01-11T02:52:50.879954 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Rendered layouts/_header.html.erb (Duration: 0.6ms | Allocations: 252)
80
-
81
- I, [2021-01-11T02:52:50.880206 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Rendered layouts/_footer.html.erb (Duration: 0.0ms | Allocations: 5)
82
-
83
- I, [2021-01-11T02:52:50.880484 #15831] INFO -- : [a019769f-7955-458b-aed4-af1fa8353e33] Completed 200 OK in 58ms (Views: 20.0ms | ActiveRecord: 4.3ms | Allocations: 16128)
84
-
85
- (END)
86
-
87
-
88
-
89
- ```
15
+ ![イメージ説明](58618abd5409b5e6d9185cc01fac404b.png)
90
16
 
91
17
  ```ruby
92
18
 

1

ルーティング、コントローラーを追記しました。

2021/01/12 05:39

投稿

kai
kai

スコア92

test CHANGED
File without changes
test CHANGED
@@ -88,6 +88,82 @@
88
88
 
89
89
  ```
90
90
 
91
+ ```ruby
92
+
93
+ #routes.rb
94
+
95
+ Rails.application.routes.draw do
96
+
97
+ devise_for :users, controllers: { :omniauth_callbacks => "omniauth_callbacks" }
98
+
99
+ root to: "home#index"
100
+
101
+ resources :users, only: [:edit, :show, :update, :destroy]
102
+
103
+ post 'users/:id' => 'users#show'
104
+
105
+ resources :messages, only: [:edit, :show, :create, :update, :destroy]
106
+
107
+ post 'messages/:id' => 'messages#show'
108
+
109
+ resources :replies, only: [:create, :destroy]
110
+
111
+ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
112
+
113
+ end
114
+
115
+ ```
116
+
117
+ ```ruby
118
+
119
+ #application_controller.rb
120
+
121
+ class ApplicationController < ActionController::Base
122
+
123
+ before_action :configure_permit_parameters, if: :devise_controller?
124
+
125
+
126
+
127
+ def after_sign_up_path_for(resource)
128
+
129
+ user_path(resource)
130
+
131
+ end
132
+
133
+
134
+
135
+ def after_sign_in_path_for(resource)
136
+
137
+ user_path(resource)
138
+
139
+ end
140
+
141
+
142
+
143
+ private
144
+
145
+ def configure_permit_parameters
146
+
147
+ devise_parameter_sanitizer.permit(:sign_up, keys: [:username, :profile_image])
148
+
149
+ end
150
+
151
+ end
152
+
153
+
154
+
155
+ #home_controller.rb
156
+
157
+ class HomeController < ApplicationController
158
+
159
+ def index
160
+
161
+ end
162
+
163
+ end
164
+
165
+ ```
166
+
91
167
  **試したこと**
92
168
 
93
169
  EC2の再起動やDBをもう一度drop→create→migrateしたりしましたが変わりありませんでした。