質問編集履歴
4
自分なりの調査追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -67,3 +67,11 @@
|
|
67
67
|
ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR: null value in column "service_name" violates not-null constraint
|
68
68
|
|
69
69
|
```
|
70
|
+
|
71
|
+
このエラーを`ActiveRecord`の`service_name`カラムの`default`を`google`にすることで回避しました。(かなり無理矢理エラーを逃れています。)
|
72
|
+
|
73
|
+
```
|
74
|
+
|
75
|
+
t.string :service_name, null: false, default: "google"
|
76
|
+
|
77
|
+
```
|
3
問題追加修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,9 +20,15 @@
|
|
20
20
|
|
21
21
|
想像で色々書き換えて見た結果バージョンを下げられている風まで辿り着きました。
|
22
22
|
|
23
|
-
しかし、道中以下のエラーが発生したため、エラー部分に該当する部分をコメントアウトしています。
|
24
23
|
|
24
|
+
|
25
|
+
道中以下のエラーが発生したため、エラー部分に該当する部分をコメントアウトしています。
|
26
|
+
|
25
|
-
|
27
|
+
すると、`service_name`が取得されず、ActiveRecordが正常に動かなくなりました。
|
28
|
+
|
29
|
+
何が起こっているのかわからずに進んでいるためにご教授お願いしたいです。
|
30
|
+
|
31
|
+
|
26
32
|
|
27
33
|
```
|
28
34
|
|
@@ -51,3 +57,13 @@
|
|
51
57
|
|
52
58
|
|
53
59
|
```
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
上記で立ち上がったものの、コメントアウトの弊害で以下のエラー
|
64
|
+
|
65
|
+
```
|
66
|
+
|
67
|
+
ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR: null value in column "service_name" violates not-null constraint
|
68
|
+
|
69
|
+
```
|
2
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,181 +16,37 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
###
|
19
|
+
### 自分なりの進捗
|
20
20
|
|
21
|
-
想像で色々書き換えて見た結果
|
21
|
+
想像で色々書き換えて見た結果バージョンを下げられている風まで辿り着きました。
|
22
22
|
|
23
|
+
しかし、道中以下のエラーが発生したため、エラー部分に該当する部分をコメントアウトしています。
|
23
24
|
|
25
|
+
実際にこれをコメントアウトすることによってどのような問題が裏で発生しているのかも教えていただけると嬉しいです。(Rack、config.ruとはというサイトを読みましたがrackが何者なのかも理解できませんでした。)
|
24
26
|
|
25
27
|
```
|
26
28
|
|
27
29
|
config.ru:6:in `block in <main>': undefined method `load_server' for #<Myapp::Application:0x000056025ff3d8a8> (NoMethodError)
|
28
30
|
|
31
|
+
Did you mean? load_seed
|
29
32
|
|
33
|
+
```
|
30
34
|
|
31
|
-
|
35
|
+
↓`config.ru`
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
# This file is used by Rack-based servers to start the application.
|
32
40
|
|
33
41
|
|
34
42
|
|
35
|
-
|
43
|
+
require_relative "config/environment"
|
36
44
|
|
37
45
|
|
38
46
|
|
39
|
-
|
47
|
+
run Rails.application
|
40
48
|
|
41
|
-
|
42
|
-
|
43
|
-
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:37:in `start'
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:147:in `block in perform'
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:138:in `tap'
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:138:in `perform'
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/command/base.rb:69:in `perform'
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/command.rb:46:in `invoke'
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands.rb:18:in `<main>'
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
from /usr/local/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
from /usr/local/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
from /usr/local/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
from /myapp/bin/rails:5:in `<top (required)>'
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
from /usr/local/bundle/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
from /myapp/bin/spring:10:in `require'
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
from /myapp/bin/spring:10:in `block in <top (required)>'
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
49
|
+
# Rails.application.load_server #ここをコメントアウトしました
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
from /myapp/bin/spring:7:in `<top (required)>'
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
from bin/rails:2:in `load'
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
from bin/rails:2:in `<main>'
|
192
|
-
|
193
|
-
|
194
50
|
|
195
51
|
|
196
52
|
|
1
情報追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,3 +9,189 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
具体的に、現在最新の `6.1.1`で簡単なアプリを作り始めたのですが、gemの`devise_token_auth`が6.1未満のバージョンでないと対応していないので、最初から作り直すしかないのか?と頭を抱えています。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
### エラー
|
20
|
+
|
21
|
+
想像で色々書き換えて見た結果発生しているエラーが以下です。一瞬立ち上がりますが、その後落ちます。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```
|
26
|
+
|
27
|
+
config.ru:6:in `block in <main>': undefined method `load_server' for #<Myapp::Application:0x000056025ff3d8a8> (NoMethodError)
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
Did you mean? load_seed
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
from /usr/local/bundle/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:37:in `start'
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:147:in `block in perform'
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:138:in `tap'
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:138:in `perform'
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/command/base.rb:69:in `perform'
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/command.rb:46:in `invoke'
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
from /usr/local/bundle/gems/railties-6.0.3.4/lib/rails/commands.rb:18:in `<main>'
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
from /usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
from /usr/local/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
from /usr/local/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
from /usr/local/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
from /myapp/bin/rails:5:in `<top (required)>'
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
from /usr/local/bundle/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
from /usr/local/bundle/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
from /myapp/bin/spring:10:in `require'
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
from /myapp/bin/spring:10:in `block in <top (required)>'
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
from /myapp/bin/spring:7:in `tap'
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
from /myapp/bin/spring:7:in `<top (required)>'
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
from bin/rails:2:in `load'
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
from bin/rails:2:in `<main>'
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
```
|