Heroku部署崩溃Ruby on Rails

twh00eeo  于 2023-04-20  发布在  Ruby
关注(0)|答案(1)|浏览(134)

我的Heroku部署崩溃了,有什么想法吗?

2023-04-18T11:07:05.459096+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2023-04-18T11:07:05.459096+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2023-04-18T11:07:05.459097+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:134:in `perform'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<main>'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459100+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459101+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-04-18T11:07:05.459101+00:00 app[web.1]: from bin/rails:4:in `<main>'
2023-04-18T11:07:05.459102+00:00 app[web.1]: /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/bundler/rubygems_integration.rb:280:in `block (2 levels) in replace_gem': pg is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)
2023-04-18T11:07:05.459102+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:3:in `<main>'
2023-04-18T11:07:05.459102+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459102+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459103+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-04-18T11:07:05.459103+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
2023-04-18T11:07:05.459103+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract/connection_handler.rb:268:in `resolve_pool_config'
2023-04-18T11:07:05.459104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract/connection_handler.rb:129:in `establish_connection'
2023-04-18T11:07:05.459104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/connection_handling.rb:52:in `establish_connection'
2023-04-18T11:07:05.459104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/railtie.rb:268:in `block (2 levels) in <class:Railtie>'
2023-04-18T11:07:05.459104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:95:in `class_eval'
2023-04-18T11:07:05.459104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:95:in `block in execute_hook'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:76:in `block in run_load_hooks'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:75:in `each'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/lazy_load_hooks.rb:75:in `run_load_hooks'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/base.rb:333:in `<module:ActiveRecord>'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/base.rb:15:in `<main>'
2023-04-18T11:07:05.459105+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459106+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459106+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-04-18T11:07:05.459106+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
2023-04-18T11:07:05.459106+00:00 app[web.1]: from /app/app/models/application_record.rb:1:in `<main>'
2023-04-18T11:07:05.459106+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459106+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459108+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-04-18T11:07:05.459108+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:30:in `require'
2023-04-18T11:07:05.459108+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2023-04-18T11:07:05.459109+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2023-04-18T11:07:05.459109+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:169:in `block in actual_eager_load_dir'
2023-04-18T11:07:05.459109+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2023-04-18T11:07:05.459109+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb:25:in `each'
2023-04-18T11:07:05.459109+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2023-04-18T11:07:05.459109+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:164:in `actual_eager_load_dir'
2023-04-18T11:07:05.459110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2023-04-18T11:07:05.459110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2023-04-18T11:07:05.459110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2023-04-18T11:07:05.459110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2023-04-18T11:07:05.459110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader.rb:297:in `block in eager_load_all'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader.rb:295:in `each'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/loader.rb:295:in `eager_load_all'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:32:in `instance_exec'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:32:in `run'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:61:in `block in run_initializers'
2023-04-18T11:07:05.459114+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
2023-04-18T11:07:05.459115+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2023-04-18T11:07:05.459115+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
2023-04-18T11:07:05.459115+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
2023-04-18T11:07:05.459115+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:347:in `each'
2023-04-18T11:07:05.459115+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:347:in `call'
2023-04-18T11:07:05.459115+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/initializable.rb:60:in `run_initializers'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/application.rb:372:in `initialize!'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from /app/config/environment.rb:5:in `<main>'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from config.ru:3:in `require_relative'
2023-04-18T11:07:05.459116+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2023-04-18T11:07:05.459117+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:116:in `eval'
2023-04-18T11:07:05.459117+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:116:in `new_from_string'
2023-04-18T11:07:05.459117+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:105:in `load_file'
2023-04-18T11:07:05.459117+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/builder.rb:66:in `parse_file'
2023-04-18T11:07:05.459117+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2023-04-18T11:07:05.459117+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:249:in `app'
2023-04-18T11:07:05.459119+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:422:in `wrapped_app'
2023-04-18T11:07:05.459119+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:312:in `block in start'
2023-04-18T11:07:05.459119+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:379:in `handle_profiling'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.6.4/lib/rack/server.rb:311:in `start'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:38:in `start'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:134:in `perform'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
2023-04-18T11:07:05.459120+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
2023-04-18T11:07:05.459121+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<main>'
2023-04-18T11:07:05.459121+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459121+00:00 app[web.1]: from <internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2023-04-18T11:07:05.459121+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-04-18T11:07:05.459121+00:00 app[web.1]: from bin/rails:4:in `<main>'
2023-04-18T11:07:05.636741+00:00 heroku[web.1]: Process exited with status 1
2023-04-18T11:07:05.677914+00:00 heroku[web.1]: State changed from starting to crashed

2023-04-18T10:29:49.347027+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=rcsetup.herokuapp.com request_id=b15e4b58-30da-4824-b22c-b3a80e0ca745 fwd="194.72.14.210" dyno= connect= service= status=503 bytes= protocol=https
2023-04-18T10:29:49.420219+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=rcsetup.herokuapp.com request_id=71294d24-f4b5-447e-b58a-4349b785e8b4 fwd="194.72.14.210" dyno= connect= service= status=503 bytes= protocol=https

这些是我得到的错误信息
我曾试图升级dynos,但没有帮助

niknxzdl

niknxzdl1#

日志文件中有趣的部分是这一行:

2023-04-18T11:07:05.459102+00:00 app[web.1]: /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/bundler/rubygems_integration.rb:280:in `block (2 levels) in replace_gem': pg is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)

具体为pg is not part of the bundle. Add it to your Gemfile.
Heroku希望你使用PostgreSQL作为数据库,如果没有其他配置的话。要使用PostgreSQL,你需要在Gemfile中使用pg gem(至少在production组中)。
将此行添加到Gemfile

gem 'pg'

然后再次运行bundle install。然后将这些更改推送到Heroku。
我建议阅读Heroku文档中关于添加pg gem的内容。

相关问题