誰可以幫我這個事?當我部署到 Heroku 時,我的應用程式不斷崩潰。我不完全確定發生了什么。
我不擅長閱讀錯誤訊息日志,這是我部署的第一個應用程式之一。我很高興提供我的 gem 檔案串列以及可能與這些有關?或者我的路線中的某種形式的配置?還是我的資料庫?
讓我知道除錯需要什么。
luke@luke-MS-7C91:~/newnewassignment/freelancer_assignment$ heroku logs
2022-06-19T11:36:41.179550 00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-06-19T11:36:43.883502 00:00 app[web.1]: => Booting Puma
2022-06-19T11:36:43.883516 00:00 app[web.1]: => Rails 7.0.3 application starting in production
2022-06-19T11:36:43.883516 00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-06-19T11:36:45.214698 00:00 app[web.1]: Puma starting in single mode...
2022-06-19T11:36:45.214735 00:00 app[web.1]: * Puma version: 5.6.4 (ruby 3.0.2-p107) ("Birdie's Version")
2022-06-19T11:36:45.214735 00:00 app[web.1]: * Min threads: 5
2022-06-19T11:36:45.214735 00:00 app[web.1]: * Max threads: 5
2022-06-19T11:36:45.214736 00:00 app[web.1]: * Environment: production
2022-06-19T11:36:45.214736 00:00 app[web.1]: * PID: 4
2022-06-19T11:36:45.214958 00:00 app[web.1]: * Listening on http://0.0.0.0:41431
2022-06-19T11:36:45.220478 00:00 app[web.1]: Use Ctrl-C to stop
2022-06-19T11:36:45.467856 00:00 heroku[web.1]: State changed from starting to up
2022-06-19T11:36:46.502654 00:00 app[web.1]: I, [2022-06-19T11:36:46.502567 #4] INFO -- : [4b7d4b19-447d-4995-b2cd-465e8b2c3460] Started GET "/" for 86.6.238.212 at 2022-06-19 11:36:46 0000
2022-06-19T11:36:46.504201 00:00 app[web.1]: I, [2022-06-19T11:36:46.504148 #4] INFO -- : [4b7d4b19-447d-4995-b2cd-465e8b2c3460] Processing by HomeController#index as HTML
2022-06-19T11:36:47.819972 00:00 app[web.1]: I, [2022-06-19T11:36:47.819885 #4] INFO -- : [4b7d4b19-447d-4995-b2cd-465e8b2c3460] Completed 500 Internal Server Error in 1316ms (ActiveRecord: 1245.3ms | Allocations: 4713)
2022-06-19T11:36:47.820510 00:00 app[web.1]: F, [2022-06-19T11:36:47.820475 #4] FATAL -- : [4b7d4b19-447d-4995-b2cd-465e8b2c3460]
2022-06-19T11:36:47.820512 00:00 app[web.1]: [4b7d4b19-447d-4995-b2cd-465e8b2c3460] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "freelancers" does not exist
2022-06-19T11:36:47.820512 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers"'::regclass
2022-06-19T11:36:47.820513 00:00 app[web.1]: ^
2022-06-19T11:36:47.820513 00:00 app[web.1]: ):
2022-06-19T11:36:47.820514 00:00 app[web.1]: [4b7d4b19-447d-4995-b2cd-465e8b2c3460]
2022-06-19T11:36:47.820514 00:00 app[web.1]: [4b7d4b19-447d-4995-b2cd-465e8b2c3460] app/controllers/home_controller.rb:7:in `index'
2022-06-19T11:36:47.821959 00:00 heroku[router]: at=info method=GET path="/" host=freelancers-applc.herokuapp.com request_id=4b7d4b19-447d-4995-b2cd-465e8b2c3460 fwd="86.6.238.212" dyno=web.1 connect=0ms service=1325ms status=500 bytes=1827 protocol=https
2022-06-19T11:36:48.010099 00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=freelancers-applc.herokuapp.com request_id=b1ceb926-a3b0-4b85-9fbf-62dbd0315434 fwd="86.6.238.212" dyno=web.1 connect=0ms service=1ms status=200 bytes=143 protocol=https
2022-06-19T11:37:19.971920 00:00 app[web.1]: I, [2022-06-19T11:37:19.971848 #4] INFO -- : [f1b6578b-f5bf-4529-b396-b93eff1d46fa] Started GET "/" for 86.6.238.212 at 2022-06-19 11:37:19 0000
2022-06-19T11:37:19.972700 00:00 app[web.1]: I, [2022-06-19T11:37:19.972643 #4] INFO -- : [f1b6578b-f5bf-4529-b396-b93eff1d46fa] Processing by HomeController#index as HTML
2022-06-19T11:37:19.979592 00:00 app[web.1]: I, [2022-06-19T11:37:19.979530 #4] INFO -- : [f1b6578b-f5bf-4529-b396-b93eff1d46fa] Completed 500 Internal Server Error in 7ms (ActiveRecord: 4.2ms | Allocations: 257)
2022-06-19T11:37:19.980043 00:00 app[web.1]: F, [2022-06-19T11:37:19.980016 #4] FATAL -- : [f1b6578b-f5bf-4529-b396-b93eff1d46fa]
2022-06-19T11:37:19.980043 00:00 app[web.1]: [f1b6578b-f5bf-4529-b396-b93eff1d46fa] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "freelancers" does not exist
2022-06-19T11:37:19.980044 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers"'::regclass
2022-06-19T11:37:19.980044 00:00 app[web.1]: ^
2022-06-19T11:37:19.980044 00:00 app[web.1]: ):
2022-06-19T11:37:19.980045 00:00 app[web.1]: [f1b6578b-f5bf-4529-b396-b93eff1d46fa]
2022-06-19T11:37:19.980045 00:00 app[web.1]: [f1b6578b-f5bf-4529-b396-b93eff1d46fa] app/controllers/home_controller.rb:7:in `index'
2022-06-19T11:37:19.980756 00:00 heroku[router]: at=info method=GET path="/" host=freelancers-applc.herokuapp.com request_id=f1b6578b-f5bf-4529-b396-b93eff1d46fa fwd="86.6.238.212" dyno=web.1 connect=0ms service=10ms status=500 bytes=1827 protocol=https
2022-06-19T11:38:03.688551 00:00 app[web.1]: I, [2022-06-19T11:38:03.688475 #4] INFO -- : [1620c46f-edc7-4a32-b1b7-acf1e42734aa] Started GET "/" for 86.6.238.212 at 2022-06-19 11:38:03 0000
2022-06-19T11:38:03.689189 00:00 app[web.1]: I, [2022-06-19T11:38:03.689143 #4] INFO -- : [1620c46f-edc7-4a32-b1b7-acf1e42734aa] Processing by HomeController#index as HTML
2022-06-19T11:38:03.694677 00:00 app[web.1]: I, [2022-06-19T11:38:03.694607 #4] INFO -- : [1620c46f-edc7-4a32-b1b7-acf1e42734aa] Completed 500 Internal Server Error in 5ms (ActiveRecord: 2.4ms | Allocations: 230)
2022-06-19T11:38:03.695139 00:00 app[web.1]: F, [2022-06-19T11:38:03.695107 #4] FATAL -- : [1620c46f-edc7-4a32-b1b7-acf1e42734aa]
2022-06-19T11:38:03.695140 00:00 app[web.1]: [1620c46f-edc7-4a32-b1b7-acf1e42734aa] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "freelancers" does not exist
2022-06-19T11:38:03.695141 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers"'::regclass
2022-06-19T11:38:03.695142 00:00 app[web.1]: ^
2022-06-19T11:38:03.695143 00:00 app[web.1]: ):
2022-06-19T11:38:03.695144 00:00 app[web.1]: [1620c46f-edc7-4a32-b1b7-acf1e42734aa]
2022-06-19T11:38:03.695144 00:00 app[web.1]: [1620c46f-edc7-4a32-b1b7-acf1e42734aa] app/controllers/home_controller.rb:7:in `index'
2022-06-19T11:38:03.695855 00:00 heroku[router]: at=info method=GET path="/" host=freelancers-applc.herokuapp.com request_id=1620c46f-edc7-4a32-b1b7-acf1e42734aa fwd="86.6.238.212" dyno=web.1 connect=0ms service=8ms status=500 bytes=1827 protocol=https
2022-06-19T11:38:04.597291 00:00 app[web.1]: I, [2022-06-19T11:38:04.597201 #4] INFO -- : [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa] Started GET "/" for 86.6.238.212 at 2022-06-19 11:38:04 0000
2022-06-19T11:38:04.598144 00:00 app[web.1]: I, [2022-06-19T11:38:04.598089 #4] INFO -- : [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa] Processing by HomeController#index as HTML
2022-06-19T11:38:04.602390 00:00 app[web.1]: I, [2022-06-19T11:38:04.602296 #4] INFO -- : [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa] Completed 500 Internal Server Error in 4ms (ActiveRecord: 2.2ms | Allocations: 240)
2022-06-19T11:38:04.602855 00:00 app[web.1]: F, [2022-06-19T11:38:04.602826 #4] FATAL -- : [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa]
2022-06-19T11:38:04.602858 00:00 app[web.1]: [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "freelancers" does not exist
2022-06-19T11:38:04.602859 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers"'::regclass
2022-06-19T11:38:04.602859 00:00 app[web.1]: ^
2022-06-19T11:38:04.602860 00:00 app[web.1]: ):
2022-06-19T11:38:04.602861 00:00 app[web.1]: [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa]
2022-06-19T11:38:04.602861 00:00 app[web.1]: [dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa] app/controllers/home_controller.rb:7:in `index'
2022-06-19T11:38:04.603558 00:00 heroku[router]: at=info method=GET path="/" host=freelancers-applc.herokuapp.com request_id=dc5a8846-8045-402a-a8d9-cdf7bcbbdcaa fwd="86.6.238.212" dyno=web.1 connect=0ms service=8ms status=500 bytes=1827 protocol=https
2022-06-19T11:39:09.889273 00:00 app[web.1]: I, [2022-06-19T11:39:09.889191 #4] INFO -- : [56ddbc7b-7392-4755-9613-c4e2d53b61f3] Started GET "/" for 86.6.238.212 at 2022-06-19 11:39:09 0000
2022-06-19T11:39:09.890103 00:00 app[web.1]: I, [2022-06-19T11:39:09.890046 #4] INFO -- : [56ddbc7b-7392-4755-9613-c4e2d53b61f3] Processing by HomeController#index as HTML
2022-06-19T11:39:09.894212 00:00 app[web.1]: I, [2022-06-19T11:39:09.894141 #4] INFO -- : [56ddbc7b-7392-4755-9613-c4e2d53b61f3] Completed 500 Internal Server Error in 4ms (ActiveRecord: 2.1ms | Allocations: 240)
2022-06-19T11:39:09.895113 00:00 app[web.1]: F, [2022-06-19T11:39:09.895056 #4] FATAL -- : [56ddbc7b-7392-4755-9613-c4e2d53b61f3]
2022-06-19T11:39:09.895115 00:00 app[web.1]: [56ddbc7b-7392-4755-9613-c4e2d53b61f3] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "freelancers" does not exist
2022-06-19T11:39:09.895116 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers"'::regclass
2022-06-19T11:39:09.895116 00:00 app[web.1]: ^
2022-06-19T11:39:09.895117 00:00 app[web.1]: ):
2022-06-19T11:39:09.895117 00:00 app[web.1]: [56ddbc7b-7392-4755-9613-c4e2d53b61f3]
2022-06-19T11:39:09.895118 00:00 app[web.1]: [56ddbc7b-7392-4755-9613-c4e2d53b61f3] app/controllers/home_controller.rb:7:in `index'
2022-06-19T11:39:09.895890 00:00 heroku[router]: at=info method=GET path="/" host=freelancers-applc.herokuapp.com request_id=56ddbc7b-7392-4755-9613-c4e2d53b61f3 fwd="86.6.238.212" dyno=web.1 connect=0ms service=8ms status=500 bytes=1827 protocol=https
2022-06-19T11:40:57.000000 00:00 app[api]: Build started by user [email protected]
2022-06-19T11:41:27.499422 00:00 heroku[web.1]: Restarting
2022-06-19T11:41:27.512420 00:00 heroku[web.1]: State changed from up to starting
2022-06-19T11:41:28.234391 00:00 heroku[web.1]: Stopping all processes with SIGTERM
2022-06-19T11:41:28.301459 00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2022-06-19T11:41:28.302141 00:00 app[web.1]: Exiting
2022-06-19T11:41:28.465197 00:00 heroku[web.1]: Process exited with status 143
2022-06-19T11:41:31.159791 00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-06-19T11:41:33.789631 00:00 app[web.1]: => Booting Puma
2022-06-19T11:41:33.789645 00:00 app[web.1]: => Rails 7.0.3 application starting in production
2022-06-19T11:41:33.789646 00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-06-19T11:41:35.043903 00:00 app[web.1]: Puma starting in single mode...
2022-06-19T11:41:35.043926 00:00 app[web.1]: * Puma version: 5.6.4 (ruby 3.0.2-p107) ("Birdie's Version")
2022-06-19T11:41:35.043927 00:00 app[web.1]: * Min threads: 5
2022-06-19T11:41:35.043927 00:00 app[web.1]: * Max threads: 5
2022-06-19T11:41:35.043927 00:00 app[web.1]: * Environment: production
2022-06-19T11:41:35.043927 00:00 app[web.1]: * PID: 4
2022-06-19T11:41:35.044142 00:00 app[web.1]: * Listening on http://0.0.0.0:40363
2022-06-19T11:41:35.049871 00:00 app[web.1]: Use Ctrl-C to stop
2022-06-19T11:41:35.558521 00:00 heroku[web.1]: State changed from starting to up
2022-06-19T11:41:36.896132 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7] Started GET "/" for 86.6.238.212 at 2022-06-19 11:41:36 0000
2022-06-19T11:41:36.897465 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7] Processing by HomeController#index as HTML
2022-06-19T11:41:36.961014 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7] Completed 500 Internal Server Error in 63ms (ActiveRecord: 29.9ms | Allocations: 4701)
2022-06-19T11:41:36.963144 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7]
2022-06-19T11:41:36.963146 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "freelancers" does not exist
2022-06-19T11:41:36.963148 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers"'::regclass
2022-06-19T11:41:36.963150 00:00 app[web.1]: ^
2022-06-19T11:41:36.963151 00:00 app[web.1]: ):
2022-06-19T11:41:36.963151 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7]
2022-06-19T11:41:36.963151 00:00 app[web.1]: [2d887a83-67fd-43af-a463-15307f715ab7] app/controllers/home_controller.rb:7:in `index'
2022-06-19T11:41:36.964304 00:00 heroku[router]: at=info method=GET path="/" host=freelancers-applc.herokuapp.com request_id=2d887a83-67fd-43af-a463-15307f715ab7 fwd="86.6.238.212" dyno=web.1 connect=0ms service=74ms status=500 bytes=1827 protocol=https```
uj5u.com熱心網友回復:
ActiveRecord::StatementInvalid (PG::UndefinedTable: 錯誤: 關系 "freelancers" 不存在 2022-06-19T11:36:47.820512 00:00 app[web.1]: LINE 9: WHERE a.attrelid = '"freelancers "'::regclass
正如您在日志表中看到的freelancers不存在。您需要運行遷移以使其正常作業。
通過Heroku CLI運行遷移
heroku run rails db:migrate -a app-name
使用 Heroku Dashboard 運行遷移
- 一、登錄Heroku
- 二、選擇應用程式 > 點擊
More選項 - 三、點擊
Run Console - 四。輸入
rake db:migrate并單擊Run
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/494902.html
下一篇:如何讓Node在堆疊溢位時中斷?
