質問編集履歴

1

ログを示しました。

2019/07/01 08:23

投稿

kulkul
kulkul

スコア12

test CHANGED
File without changes
test CHANGED
@@ -122,6 +122,60 @@
122
122
 
123
123
 
124
124
 
125
+ ログ
126
+
127
+ ```
128
+
129
+ Started POST "/projects/create" for ::1 at 2019-06-30 20:31:15 +0900
130
+
131
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
132
+
133
+ /Users/kyohei/Desktop/match/match_app/app/controllers/application_controller.rb:9: warning: found = in conditional, should be ==
134
+
135
+ Processing by ProjectsController#create as HTML
136
+
137
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"Lcc2pEJVb00UAjmTnTTTJuBrIOh5xoP4EFVkQMoWAnXmHRHJ3D5ICF3KfjCox8yh0NzstWnf2ueGxG29QH4WiA==", "title"=>"s", "contents"=>"s", "wanted"=>"", "contact_info"=>"s", "comments"=>""}
138
+
139
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 5], ["LIMIT", 1]]
140
+
141
+ Completed 500 Internal Server Error in 18ms (ActiveRecord: 0.6ms)
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ NoMethodError (undefined method `id' for nil:NilClass):
150
+
151
+
152
+
153
+ app/controllers/projects_controller.rb:23:in `create'
154
+
155
+ Rendering /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
156
+
157
+ Rendering /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
158
+
159
+ Rendered /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (1.9ms)
160
+
161
+ Rendering /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
162
+
163
+ Rendered /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.1ms)
164
+
165
+ Rendering /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
166
+
167
+ Rendered /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
168
+
169
+ Rendered /Users/kyohei/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (72.8ms)
170
+
171
+ ^C- Gracefully stopping, waiting for requests to finish
172
+
173
+ === puma shutdown: 2019-06-30 20:59:10 +0900 ===
174
+
175
+ ```
176
+
177
+
178
+
125
179
  ### 試したこと
126
180
 
127
181
  session[:user_id]も正しく数値が入れられており、DBのusersテーブルにもユーザーは存在しています。しかし@current_userが存在しないとなってしまうのはなぜでしょうか。