首页 > 解决方案 > (文章的未知属性“user_id”。)heroku 错误

问题描述

我在窗口 7 中使用 docker 在 ruby​​ on rails 中做一个应用程序,它工作正常,但是当我到 heroku 并进行迁移时,页面不允许我创建我所做的任何类(文章、帖子、评论)这是我要运行的网页:

这是我的网页与 heroku

这是日志:

C:\Users\mr.pepo877\Desktop\intentos_del_proyecto_de_software\grupo-43>heroku logs
2018-06-01T23:12:40.951932+00:00 app[web.1]: I, [2018-06-01T23:12:40.951857 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0] Processing by Devise::SessionsController#create as HTML
2018-06-01T23:12:40.952029+00:00 app[web.1]: I, [2018-06-01T23:12:40.951964 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0]   Parameters: {"utf8"=>"V", "authenticity_token"=>"bXl3s26tf7TsI/PWDhwQJsmzDmvOhJ4iX8qo5gG9cpSj+k219CnK98Mc3GnCb83Fi6VgTXW/DAM0JTS/J7vM+A==", "user"=>{"email"=>"rjdelrio@uc.cl", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
2018-06-01T23:12:40.956396+00:00 app[web.1]: D, [2018-06-01T23:12:40.956299 #4] DEBUG -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0]   User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["email", "rjdelrio@uc.cl"], ["LIMIT", 1]]
2018-06-01T23:12:40.956826+00:00 app[web.1]: I, [2018-06-01T23:12:40.956747 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0] Completed 401 Unauthorized in 5ms (ActiveRecord: 1.2ms)
2018-06-01T23:12:40.958314+00:00 app[web.1]: I, [2018-06-01T23:12:40.957831 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0] Processing by Devise::SessionsController#new as HTML
2018-06-01T23:12:40.958317+00:00 app[web.1]: I, [2018-06-01T23:12:40.957935 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0]   Parameters: {"utf8"=>"V", "authenticity_token"=>"bXl3s26tf7TsI/PWDhwQJsmzDmvOhJ4iX8qo5gG9cpSj+k219CnK98Mc3GnCb83Fi6VgTXW/DAM0JTS/J7vM+A==", "user"=>{"email"=>"rjdelrio@uc.cl", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
2018-06-01T23:12:41.107417+00:00 app[web.1]: I, [2018-06-01T23:12:41.107287 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0]   Rendering devise/sessions/new.html.erb within layouts/application
2018-06-01T23:12:41.109435+00:00 app[web.1]: I, [2018-06-01T23:12:41.109370 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0]   Rendered devise/shared/_links.html.erb (0.2ms)
2018-06-01T23:12:41.109530+00:00 app[web.1]: I, [2018-06-01T23:12:41.109476 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0]   Rendered devise/sessions/new.html.erb within layouts/application (2.1ms)
2018-06-01T23:12:41.110313+00:00 app[web.1]: I, [2018-06-01T23:12:41.110234 #4]  INFO -- : [39f3671d-8c77-4f2e-90f6-6f56ac4636d0] Completed 200 OK in 152ms (Views: 3.2ms | ActiveRecord: 0.0ms)
2018-06-01T23:12:46.535316+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=nameless-inlet-37173.herokuapp.com request_id=42622dd2-f670-4dff-b706-639d40f96475 fwd="190.215.1.147" dyno=web.1 connect=1ms service=10ms status=200 bytes=2694 protocol=https
2018-06-01T23:12:46.528233+00:00 app[web.1]: I, [2018-06-01T23:12:46.528116 #4]  INFO -- : [42622dd2-f670-4dff-b706-639d40f96475] Started GET "/users/sign_in" for 190.215.1.147 at 2018-06-01 23:12:46 +0000
2018-06-01T23:12:46.529349+00:00 app[web.1]: I, [2018-06-01T23:12:46.529267 #4]  INFO -- : [42622dd2-f670-4dff-b706-639d40f96475] Processing by Devise::SessionsController#new as HTML
2018-06-01T23:12:46.531346+00:00 app[web.1]: I, [2018-06-01T23:12:46.531276 #4]  INFO -- : [42622dd2-f670-4dff-b706-639d40f96475]   Rendering devise/sessions/new.html.erb within layouts/application
2018-06-01T23:12:46.533560+00:00 app[web.1]: I, [2018-06-01T23:12:46.533484 #4]  INFO -- : [42622dd2-f670-4dff-b706-639d40f96475]   Rendered devise/shared/_links.html.erb (0.2ms)
2018-06-01T23:12:46.533654+00:00 app[web.1]: I, [2018-06-01T23:12:46.533586 #4]  INFO -- : [42622dd2-f670-4dff-b706-639d40f96475]   Rendered devise/sessions/new.html.erb within layouts/application (2.2ms)
2018-06-01T23:12:46.534481+00:00 app[web.1]: I, [2018-06-01T23:12:46.534421 #4]  INFO -- : [42622dd2-f670-4dff-b706-639d40f96475] Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.0ms)
2018-06-01T23:12:54.753720+00:00 app[web.1]: I, [2018-06-01T23:12:54.753626 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0] Started POST "/users/sign_in" for 190.215.1.147 at 2018-06-01 23:12:54 +0000
2018-06-01T23:12:54.754566+00:00 app[web.1]: I, [2018-06-01T23:12:54.754493 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0] Processing by Devise::SessionsController#create as HTML
2018-06-01T23:12:54.754660+00:00 app[web.1]: I, [2018-06-01T23:12:54.754590 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0]   Parameters: {"utf8"=>"V", "authenticity_token"=>"etBl8hu+e2gFcGCa9+ohwnYHiuZom9BjEdaPjkm8sGk0NlC0QoYPqHjeozjIrR+Fugw7ht243MP+IqiajWJeoA==", "user"=>{"email"=>"rjdelrio@uc.cl", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
2018-06-01T23:12:54.758501+00:00 app[web.1]: D, [2018-06-01T23:12:54.758412 #4] DEBUG -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0]   User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["email", "rjdelrio@uc.cl"], ["LIMIT", 1]]
2018-06-01T23:12:54.758933+00:00 app[web.1]: I, [2018-06-01T23:12:54.758860 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0] Completed 401 Unauthorized in 4ms (ActiveRecord: 1.2ms)
2018-06-01T23:12:54.759694+00:00 app[web.1]: I, [2018-06-01T23:12:54.759631 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0] Processing by Devise::SessionsController#new as HTML
2018-06-01T23:12:54.759777+00:00 app[web.1]: I, [2018-06-01T23:12:54.759718 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0]   Parameters: {"utf8"=>"V", "authenticity_token"=>"etBl8hu+e2gFcGCa9+ohwnYHiuZom9BjEdaPjkm8sGk0NlC0QoYPqHjeozjIrR+Fugw7ht243MP+IqiajWJeoA==", "user"=>{"email"=>"rjdelrio@uc.cl", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
2018-06-01T23:12:54.904276+00:00 app[web.1]: I, [2018-06-01T23:12:54.904150 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0]   Rendering devise/sessions/new.html.erb within layouts/application
2018-06-01T23:12:54.906385+00:00 app[web.1]: I, [2018-06-01T23:12:54.906291 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0]   Rendered devise/shared/_links.html.erb (0.3ms)
2018-06-01T23:12:54.906480+00:00 app[web.1]: I, [2018-06-01T23:12:54.906418 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0]   Rendered devise/sessions/new.html.erb within layouts/application (2.1ms)
2018-06-01T23:12:54.907215+00:00 app[web.1]: I, [2018-06-01T23:12:54.907147 #4]  INFO -- : [ba7c6a75-e2d0-489b-9521-3033640bc2e0] Completed 200 OK in 147ms (Views: 3.3ms | ActiveRecord: 0.0ms)
2018-06-01T23:12:54.909060+00:00 heroku[router]: at=info method=POST path="/users/sign_in" host=nameless-inlet-37173.herokuapp.com request_id=ba7c6a75-e2d0-489b-9521-3033640bc2e0 fwd="190.215.1.147" dyno=web.1 connect=0ms service=157ms status=200 bytes=2771 protocol=https
2018-06-01T23:13:02.946519+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=nameless-inlet-37173.herokuapp.com request_id=2b769154-6b1b-4e43-b1c8-c4cade4a9f9b fwd="190.215.1.147" dyno=web.1 connect=0ms service=10ms status=200 bytes=2694 protocol=https
2018-06-01T23:13:02.938539+00:00 app[web.1]: I, [2018-06-01T23:13:02.938413 #4]  INFO -- : [2b769154-6b1b-4e43-b1c8-c4cade4a9f9b] Started GET "/users/sign_in" for 190.215.1.147 at 2018-06-01 23:13:02 +0000
2018-06-01T23:13:02.941484+00:00 app[web.1]: I, [2018-06-01T23:13:02.941399 #4]  INFO -- : [2b769154-6b1b-4e43-b1c8-c4cade4a9f9b]   Rendering devise/sessions/new.html.erb within layouts/application
2018-06-01T23:13:02.939576+00:00 app[web.1]: I, [2018-06-01T23:13:02.939503 #4]  INFO -- : [2b769154-6b1b-4e43-b1c8-c4cade4a9f9b] Processing by Devise::SessionsController#new as HTML
2018-06-01T23:13:02.946224+00:00 app[web.1]: I, [2018-06-01T23:13:02.946109 #4]  INFO -- : [2b769154-6b1b-4e43-b1c8-c4cade4a9f9b] Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)
2018-06-01T23:13:02.944752+00:00 app[web.1]: I, [2018-06-01T23:13:02.944670 #4]  INFO -- : [2b769154-6b1b-4e43-b1c8-c4cade4a9f9b]   Rendered devise/shared/_links.html.erb (0.4ms)
2018-06-01T23:13:02.944883+00:00 app[web.1]: I, [2018-06-01T23:13:02.944811 #4]  INFO -- : [2b769154-6b1b-4e43-b1c8-c4cade4a9f9b]   Rendered devise/sessions/new.html.erb within layouts/application (3.3ms)
2018-06-01T23:13:15.216094+00:00 heroku[router]: at=info method=GET path="/articles/new" host=nameless-inlet-37173.herokuapp.com request_id=a567ca7c-d389-432d-b33d-23970d158a6e fwd="190.215.1.147" dyno=web.1 connect=0ms service=4ms status=302 bytes=965 protocol=https
2018-06-01T23:13:15.214362+00:00 app[web.1]: I, [2018-06-01T23:13:15.214212 #4]  INFO -- : [a567ca7c-d389-432d-b33d-23970d158a6e] Started GET "/articles/new" for 190.215.1.147 at 2018-06-01 23:13:15 +0000
2018-06-01T23:13:15.215147+00:00 app[web.1]: I, [2018-06-01T23:13:15.215077 #4]  INFO -- : [a567ca7c-d389-432d-b33d-23970d158a6e] Processing by ArticlesController#new as HTML
2018-06-01T23:13:15.216072+00:00 app[web.1]: I, [2018-06-01T23:13:15.215986 #4]  INFO -- : [a567ca7c-d389-432d-b33d-23970d158a6e] Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)
2018-06-01T23:13:15.387971+00:00 app[web.1]: I, [2018-06-01T23:13:15.387882 #4]  INFO -- : [19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c] Started GET "/users/sign_in" for 190.215.1.147 at 2018-06-01 23:13:15 +0000
2018-06-01T23:13:15.390470+00:00 app[web.1]: I, [2018-06-01T23:13:15.390352 #4]  INFO -- : [19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c] Processing by Devise::SessionsController#new as HTML
2018-06-01T23:13:15.394616+00:00 app[web.1]: I, [2018-06-01T23:13:15.394525 #4]  INFO -- : [19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c]   Rendering devise/sessions/new.html.erb within layouts/application
2018-06-01T23:13:15.400740+00:00 app[web.1]: I, [2018-06-01T23:13:15.400627 #4]  INFO -- : [19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c]   Rendered devise/shared/_links.html.erb (2.7ms)
2018-06-01T23:13:15.400932+00:00 app[web.1]: I, [2018-06-01T23:13:15.400833 #4]  INFO -- : [19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c]   Rendered devise/sessions/new.html.erb within layouts/application (6.2ms)
2018-06-01T23:13:15.402392+00:00 app[web.1]: I, [2018-06-01T23:13:15.402316 #4]  INFO -- : [19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c] Completed 200 OK in 12ms (Views: 8.6ms | ActiveRecord: 0.0ms)
2018-06-01T23:13:15.402184+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=nameless-inlet-37173.herokuapp.com request_id=19fb8c6d-04e1-4c86-80ac-8c61e7f1ff3c fwd="190.215.1.147" dyno=web.1 connect=1ms service=18ms status=200 bytes=2780 protocol=https
2018-06-01T23:13:54.361300+00:00 heroku[router]: at=info method=GET path="/users/sign_up" host=nameless-inlet-37173.herokuapp.com request_id=d53fe3b9-3863-4491-9944-5ded09c70e82 fwd="190.215.1.147" dyno=web.1 connect=1ms service=12ms status=200 bytes=2658 protocol=https
2018-06-01T23:13:54.350424+00:00 app[web.1]: I, [2018-06-01T23:13:54.350308 #4]  INFO -- : [d53fe3b9-3863-4491-9944-5ded09c70e82] Started GET "/users/sign_up" for 190.215.1.147 at 2018-06-01 23:13:54 +0000
2018-06-01T23:13:54.351561+00:00 app[web.1]: I, [2018-06-01T23:13:54.351475 #4]  INFO -- : [d53fe3b9-3863-4491-9944-5ded09c70e82] Processing by Devise::RegistrationsController#new as HTML
2018-06-01T23:13:54.353410+00:00 app[web.1]: I, [2018-06-01T23:13:54.353326 #4]  INFO -- : [d53fe3b9-3863-4491-9944-5ded09c70e82]   Rendering devise/registrations/new.html.erb within layouts/application
2018-06-01T23:13:54.356763+00:00 app[web.1]: I, [2018-06-01T23:13:54.356680 #4]  INFO -- : [d53fe3b9-3863-4491-9944-5ded09c70e82]   Rendered devise/shared/_links.html.erb (0.3ms)
2018-06-01T23:13:54.356909+00:00 app[web.1]: I, [2018-06-01T23:13:54.356834 #4]  INFO -- : [d53fe3b9-3863-4491-9944-5ded09c70e82]   Rendered devise/registrations/new.html.erb within layouts/application (3.4ms)
2018-06-01T23:13:54.358354+00:00 app[web.1]: I, [2018-06-01T23:13:54.358276 #4]  INFO -- : [d53fe3b9-3863-4491-9944-5ded09c70e82] Completed 200 OK in 7ms (Views: 5.4ms | ActiveRecord: 0.0ms)
2018-06-01T23:14:14.728043+00:00 app[web.1]: I, [2018-06-01T23:14:14.727947 #4]  INFO -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb] Started POST "/users" for 190.215.1.147 at 2018-06-01 23:14:14 +0000
2018-06-01T23:14:14.728901+00:00 app[web.1]: I, [2018-06-01T23:14:14.728817 #4]  INFO -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb] Processing by Devise::RegistrationsController#create as HTML
2018-06-01T23:14:14.729000+00:00 app[web.1]: I, [2018-06-01T23:14:14.728920 #4]  INFO -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]   Parameters: {"utf8"=>"V", "authenticity_token"=>"ibKTF1L3f7u2TTlb3M/oifhtmKWByl/PMfbJbKF7iN1uitT7aMSGJIYRhz4cPbJ7oJhVWBXSuVBLee8j0AeoBQ==", "user"=>{"email"=>"rjdelrio@uc.cl", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2018-06-01T23:14:14.878419+00:00 app[web.1]: D, [2018-06-01T23:14:14.878268 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]    (0.8ms)  BEGIN
2018-06-01T23:14:14.880341+00:00 app[web.1]: D, [2018-06-01T23:14:14.880260 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]   User Exists (1.1ms)  SELECT  1 AS one FROM "users" WHERE "users"."email" = $1 LIMIT $2  [["email", "rjdelrio@uc.cl"], ["LIMIT", 1]]
2018-06-01T23:14:14.884811+00:00 app[web.1]: D, [2018-06-01T23:14:14.884731 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]   SQL (2.9ms)  INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"  [["email", "rjdelrio@uc.cl"], ["encrypted_password", "$2a$11$BIqDuCBl.lt2lRq5Hzt3NO/w4oiheuqBG6ilYrh/wmBCJj/Ck04HK"], ["created_at", "2018-06-01 23:14:14.880607"], ["updated_at", "2018-06-01 23:14:14.880607"]]
2018-06-01T23:14:14.886831+00:00 app[web.1]: D, [2018-06-01T23:14:14.886767 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]    (1.7ms)  COMMIT
2018-06-01T23:14:14.888388+00:00 app[web.1]: D, [2018-06-01T23:14:14.888301 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]    (0.7ms)  BEGIN
2018-06-01T23:14:14.890699+00:00 app[web.1]: D, [2018-06-01T23:14:14.890628 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]   SQL (1.2ms)  UPDATE "users" SET "sign_in_count" = $1, "current_sign_in_at" = $2, "last_sign_in_at" = $3, "current_sign_in_ip" = $4, "last_sign_in_ip" = $5, "updated_at" = $6 WHERE "users"."id" = $7  [["sign_in_count", 1], ["current_sign_in_at", "2018-06-01 23:14:14.887164"], ["last_sign_in_at", "2018-06-01 23:14:14.887164"], ["current_sign_in_ip", "190.215.1.147/32"], ["last_sign_in_ip", "190.215.1.147/32"], ["updated_at", "2018-06-01 23:14:14.888495"], ["id", 1]]
2018-06-01T23:14:14.892556+00:00 app[web.1]: D, [2018-06-01T23:14:14.892470 #4] DEBUG -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb]    (1.5ms)  COMMIT
2018-06-01T23:14:14.893242+00:00 app[web.1]: I, [2018-06-01T23:14:14.893148 #4]  INFO -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb] Redirected to https://nameless-inlet-37173.herokuapp.com/articles/new
2018-06-01T23:14:14.893414+00:00 app[web.1]: I, [2018-06-01T23:14:14.893344 #4]  INFO -- : [99ba270b-e82e-4d85-a6bd-14a30a1ef2fb] Completed 302 Found in 164ms (ActiveRecord: 9.8ms)
2018-06-01T23:14:14.893567+00:00 heroku[router]: at=info method=POST path="/users" host=nameless-inlet-37173.herokuapp.com request_id=99ba270b-e82e-4d85-a6bd-14a30a1ef2fb fwd="190.215.1.147" dyno=web.1 connect=1ms service=169ms status=302 bytes=1110 protocol=https
2018-06-01T23:14:15.065643+00:00 heroku[router]: at=info method=GET path="/articles/new" host=nameless-inlet-37173.herokuapp.com request_id=656f8bab-199e-4dcd-a3ed-04bfc8d03f6e fwd="190.215.1.147" dyno=web.1 connect=0ms service=10ms status=500 bytes=1827 protocol=https
2018-06-01T23:14:15.057756+00:00 app[web.1]: I, [2018-06-01T23:14:15.057645 #4]  INFO -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e] Started GET "/articles/new" for 190.215.1.147 at 2018-06-01 23:14:15 +0000
2018-06-01T23:14:15.058682+00:00 app[web.1]: I, [2018-06-01T23:14:15.058594 #4]  INFO -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e] Processing by ArticlesController#new as HTML
2018-06-01T23:14:15.062516+00:00 app[web.1]: D, [2018-06-01T23:14:15.062436 #4] DEBUG -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e]   User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
2018-06-01T23:14:15.064159+00:00 app[web.1]: I, [2018-06-01T23:14:15.064072 #4]  INFO -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e] Completed 500 Internal Server Error in 5ms (ActiveRecord: 1.2ms)
2018-06-01T23:14:15.065147+00:00 app[web.1]: F, [2018-06-01T23:14:15.065055 #4] FATAL -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e]
2018-06-01T23:14:15.065376+00:00 app[web.1]: F, [2018-06-01T23:14:15.065244 #4] FATAL -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e]
2018-06-01T23:14:15.065373+00:00 app[web.1]: F, [2018-06-01T23:14:15.065164 #4] FATAL -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e] ActiveModel::UnknownAttributeError (unknown attribute 'user_id' for Article.):
2018-06-01T23:14:15.065382+00:00 app[web.1]: F, [2018-06-01T23:14:15.065324 #4] FATAL -- : [656f8bab-199e-4dcd-a3ed-04bfc8d03f6e] app/controllers/articles_controller.rb:8:in `new'
2018-06-01T23:14:26.444935+00:00 heroku[router]: at=info method=GET path="/" host=nameless-inlet-37173.herokuapp.com request_id=e723a70f-ba91-4680-ad2b-7f3f98563c18 fwd="190.215.1.147" dyno=web.1 connect=1ms service=9ms status=200 bytes=1820 protocol=https
2018-06-01T23:14:26.436769+00:00 app[web.1]: I, [2018-06-01T23:14:26.436658 #4]  INFO -- : [e723a70f-ba91-4680-ad2b-7f3f98563c18] Started GET "/" for 190.215.1.147 at 2018-06-01 23:14:26 +0000
2018-06-01T23:14:26.437460+00:00 app[web.1]: I, [2018-06-01T23:14:26.437390 #4]  INFO -- : [e723a70f-ba91-4680-ad2b-7f3f98563c18] Processing by WelcomeController#index as HTML
2018-06-01T23:14:26.438418+00:00 app[web.1]: I, [2018-06-01T23:14:26.438341 #4]  INFO -- : [e723a70f-ba91-4680-ad2b-7f3f98563c18]   Rendering welcome/index.html.erb within layouts/application
2018-06-01T23:14:26.438811+00:00 app[web.1]: I, [2018-06-01T23:14:26.438733 #4]  INFO -- : [e723a70f-ba91-4680-ad2b-7f3f98563c18]   Rendered welcome/index.html.erb within layouts/application (0.3ms)
2018-06-01T23:14:26.442446+00:00 app[web.1]: D, [2018-06-01T23:14:26.442365 #4] DEBUG -- : [e723a70f-ba91-4680-ad2b-7f3f98563c18]   User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
2018-06-01T23:14:26.443240+00:00 app[web.1]: I, [2018-06-01T23:14:26.443166 #4]  INFO -- : [e723a70f-ba91-4680-ad2b-7f3f98563c18] Completed 200 OK in 6ms (Views: 3.8ms | ActiveRecord: 1.2ms)
2018-06-01T23:14:38.234306+00:00 heroku[router]: at=info method=GET path="/articles" host=nameless-inlet-37173.herokuapp.com request_id=eb686b73-c161-41d6-901e-5c22bfa98ef0 fwd="190.215.1.147" dyno=web.1 connect=1ms service=11ms status=200 bytes=1847 protocol=https
2018-06-01T23:14:38.224959+00:00 app[web.1]: I, [2018-06-01T23:14:38.224841 #4]  INFO -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0] Started GET "/articles" for 190.215.1.147 at 2018-06-01 23:14:38 +0000
2018-06-01T23:14:38.225823+00:00 app[web.1]: I, [2018-06-01T23:14:38.225752 #4]  INFO -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0] Processing by ArticlesController#index as HTML
2018-06-01T23:14:38.226936+00:00 app[web.1]: I, [2018-06-01T23:14:38.226863 #4]  INFO -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0]   Rendering articles/index.html.erb within layouts/application
2018-06-01T23:14:38.229182+00:00 app[web.1]: D, [2018-06-01T23:14:38.229098 #4] DEBUG -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0]   Article Load (0.9ms)  SELECT "articles".* FROM "articles"
2018-06-01T23:14:38.229560+00:00 app[web.1]: I, [2018-06-01T23:14:38.229453 #4]  INFO -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0]   Rendered articles/index.html.erb within layouts/application (2.5ms)
2018-06-01T23:14:38.231899+00:00 app[web.1]: D, [2018-06-01T23:14:38.231825 #4] DEBUG -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0]   User Load (1.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
2018-06-01T23:14:38.232631+00:00 app[web.1]: I, [2018-06-01T23:14:38.232554 #4]  INFO -- : [eb686b73-c161-41d6-901e-5c22bfa98ef0] Completed 200 OK in 7ms (Views: 3.9ms | ActiveRecord: 2.0ms)
2018-06-01T23:14:39.536968+00:00 heroku[router]: at=info method=GET path="/articles/new" host=nameless-inlet-37173.herokuapp.com request_id=aa23cbea-7aac-458e-9770-ddec22ba9ecf fwd="190.215.1.147" dyno=web.1 connect=1ms service=10ms status=500 bytes=1827 protocol=https
2018-06-01T23:14:39.528073+00:00 app[web.1]: I, [2018-06-01T23:14:39.527952 #4]  INFO -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf] Started GET "/articles/new" for 190.215.1.147 at 2018-06-01 23:14:39 +0000
2018-06-01T23:14:39.529192+00:00 app[web.1]: I, [2018-06-01T23:14:39.529114 #4]  INFO -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf] Processing by ArticlesController#new as HTML
2018-06-01T23:14:39.532832+00:00 app[web.1]: D, [2018-06-01T23:14:39.532751 #4] DEBUG -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf]   User Load (1.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
2018-06-01T23:14:39.535516+00:00 app[web.1]: F, [2018-06-01T23:14:39.535442 #4] FATAL -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf]
2018-06-01T23:14:39.535657+00:00 app[web.1]: F, [2018-06-01T23:14:39.535590 #4] FATAL -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf] ActiveModel::UnknownAttributeError (unknown attribute 'user_id' for Article.):
2018-06-01T23:14:39.534608+00:00 app[web.1]: I, [2018-06-01T23:14:39.534528 #4]  INFO -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf] Completed 500 Internal Server Error in 5ms (ActiveRecord: 1.1ms)
2018-06-01T23:14:39.535748+00:00 app[web.1]: F, [2018-06-01T23:14:39.535683 #4] FATAL -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf]
2018-06-01T23:14:39.535846+00:00 app[web.1]: F, [2018-06-01T23:14:39.535783 #4] FATAL -- : [aa23cbea-7aac-458e-9770-ddec22ba9ecf] app/controllers/articles_controller.rb:8:in `new'

这是迁移:

C:\Users\mr.pepo877\Desktop\intentos_del_proyecto_de_software\grupo-43>heroku run bundle exec rake db:migrate
Running bundle exec rake db:migrate on ? nameless-inlet-37173... up, run.8000 (Free)
D, [2018-06-01T23:11:31.915698 #4] DEBUG -- :   (32.6ms)    CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
D, [2018-06-01T23:11:31.928487 #4] DEBUG -- :   (8.6ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
D, [2018-06-01T23:11:31.930891 #4] DEBUG -- :   (0.9ms) SELECT pg_try_advisory_lock(6046128209120987715)
D, [2018-06-01T23:11:31.949701 #4] DEBUG -- :   (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
I, [2018-06-01T23:11:31.951621 #4]  INFO -- : Migrating to CreateArticles (20180510185732)
D, [2018-06-01T23:11:31.954491 #4] DEBUG -- :   (1.0ms) BEGIN
== 20180510185732 CreateArticles: migrating ===================================
-- create_table(:articles)
D, [2018-06-01T23:11:31.965434 #4] DEBUG -- :   (10.1ms)    CREATE TABLE "articles" ("id" bigserial primary key, "title" character varying, "text" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
     -> 0.0111s
== 20180510185732 CreateArticles: migrated (0.0114s) ==========================

D, [2018-06-01T23:11:31.972337 #4] DEBUG -- :    SQL (1.2ms)    INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180510185732"]]
D, [2018-06-01T23:11:31.975858 #4] DEBUG -- :   (2.8ms) COMMIT
I, [2018-06-01T23:11:31.976361 #4]  INFO -- : Migrating to CreatePosts (20180510223907)
D, [2018-06-01T23:11:31.978260 #4] DEBUG -- :   (0.9ms) BEGIN
== 20180510223907 CreatePosts: migrating ======================================
-- create_table(:users)
D, [2018-06-01T23:11:32.073778 #4] DEBUG -- :   (10.0ms)    CREATE TABLE "users" ("id" bigserial primary key, "email" character varying DEFAULT '' NOT NULL, "encrypted_password" character varying DEFAULT '' NOT NULL, "reset_password_token" character varying, "reset_password_sent_at" timestamp, "remember_created_at" timestamp, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" timestamp, "last_sign_in_at" timestamp, "current_sign_in_ip" inet, "last_sign_in_ip" inet, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
     -> 0.0226s
-- add_index(:users, :email, {:unique=>true})
D, [2018-06-01T23:11:32.081799 #4] DEBUG -- :   (3.6ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users"   ("email")
     -> 0.0078s
-- add_index(:users, :reset_password_token, {:unique=>true})
D, [2018-06-01T23:11:32.089162 #4] DEBUG -- :   (3.7ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users"    ("reset_password_token")
     -> 0.0072s
== 20180527192651 DeviseCreateUsers: migrated (0.0421s) =======================

D, [2018-06-01T23:11:32.091072 #4] DEBUG -- :    SQL (1.0ms)    INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180527192651"]]
D, [2018-06-01T23:11:32.095502 #4] DEBUG -- :   (4.1ms) COMMIT
I, [2018-06-01T23:11:32.095640 #4]  INFO -- : Migrating to AddUserIdToArticles (20180528031303)
D, [2018-06-01T23:11:32.099672 #4] DEBUG -- :   (3.3ms) BEGIN
== 20180528031303 AddUserIdToArticles: migrating ==============================
-- add_column(:articles, :user_id, :integer)
D, [2018-06-01T23:11:32.103306 #4] DEBUG -- :   (3.0ms) ALTER TABLE "articles" ADD "user_id" integer
     -> 0.0036s
-- add_index(:articles, :user_id)
D, [2018-06-01T23:11:32.115101 #4] DEBUG -- :   (4.5ms) CREATE  INDEX   "index_articles_on_user_id" ON "articles"   ("user_id")
     -> 0.0116s
== 20180528031303 AddUserIdToArticles: migrated (0.0154s) =====================

D, [2018-06-01T23:11:32.117541 #4] DEBUG -- :    SQL (1.0ms)    INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180528031303"]]
D, [2018-06-01T23:11:32.119590 #4] DEBUG -- :   (1.7ms) COMMIT
I, [2018-06-01T23:11:32.119740 #4]  INFO -- : Migrating to AddUserIdToPosts (20180528031728)
D, [2018-06-01T23:11:32.121442 #4] DEBUG -- :   (0.8ms) BEGIN
== 20180528031728 AddUserIdToPosts: migrating =================================
-- add_column(:posts, :user_id, :integer)
D, [2018-06-01T23:11:32.123252 #4] DEBUG -- :   (1.3ms) ALTER TABLE "posts" ADD "user_id" integer
     -> 0.0016s
-- add_index(:posts, :user_id)
D, [2018-06-01T23:11:32.130761 #4] DEBUG -- :   (3.8ms) CREATE  INDEX   "index_posts_on_user_id" ON "posts" ("user_id")
     -> 0.0073s
== 20180528031728 AddUserIdToPosts: migrated (0.0093s) ========================

D, [2018-06-01T23:11:32.132690 #4] DEBUG -- :    SQL (1.0ms)    INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180528031728"]]
D, [2018-06-01T23:11:32.134810 #4] DEBUG -- :   (1.8ms) COMMIT
I, [2018-06-01T23:11:32.134973 #4]  INFO -- : Migrating to AddUserIdToComments (20180528031754)
D, [2018-06-01T23:11:32.136607 #4] DEBUG -- :   (0.9ms) BEGIN
== 20180528031754 AddUserIdToComments: migrating ==============================
-- add_column(:comments, :user_id, :integer)
D, [2018-06-01T23:11:32.138402 #4] DEBUG -- :   (1.2ms) ALTER TABLE "comments" ADD "user_id" integer
     -> 0.0016s
-- add_index(:comments, :user_id)
D, [2018-06-01T23:11:32.145780 #4] DEBUG -- :   (3.9ms) CREATE  INDEX   "index_comments_on_user_id" ON "comments"   ("user_id")
     -> 0.0073s
== 20180528031754 AddUserIdToComments: migrated (0.0092s) =====================

D, [2018-06-01T23:11:32.147888 #4] DEBUG -- :    SQL (1.1ms)    INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180528031754"]]
D, [2018-06-01T23:11:32.149736 #4] DEBUG -- :   (1.6ms) COMMIT
D, [2018-06-01T23:11:32.160859 #4] DEBUG -- :    ActiveRecord::InternalMetadata Load (1.1ms)    SELECT  "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2   [["key", "environment"], ["LIMIT", 1]]
D, [2018-06-01T23:11:32.171331 #4] DEBUG -- :   (1.0ms) BEGIN
D, [2018-06-01T23:11:32.173951 #4] DEBUG -- :    SQL (1.2ms)    INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "production"], ["created_at", "2018-06-01 23:11:32.171862"], ["updated_at", "2018-06-01 23:11:32.171862"]]
D, [2018-06-01T23:11:32.176077 #4] DEBUG -- :   (1.6ms) COMMIT
D, [2018-06-01T23:11:32.177359 #4] DEBUG -- :   (1.0ms) SELECT pg_advisory_unlock(6046128209120987715)

标签: postgresqlruby-on-rails-3heroku

解决方案


heroku pg:reset DATABASE --confirm name-of-your-app 

然后: rake db:migrate 再次


推荐阅读