如何解决Heroku上的H-10应用程序崩溃错误?

r6l8ljro  于 2023-04-12  发布在  其他
关注(0)|答案(1)|浏览(135)

我有一个旧的Rails应用程序托管在Heroku和PostgreSQL上,我正在努力进入Heroku-18(我知道18的支持寿命)。
我必须升级rails应用程序才能进入Heroku 18以前的设置:Ruby 2.1.2 on Rails 4.1.6 / Heroku 14 Work in progress setup:Ruby 2.7.7 on Rails 5.2.2 / Heroku 18
一切都在本地工作,但我有一个应用程序崩溃问题后Heroku部署。
heroku logs --tail
app\[web.1\]: Exiting heroku\[web.1\]: Process exited with status 1 heroku\[web.1\]: State changed from starting to crashed heroku\[router\]: at=error code=H10 desc="App crashed" method=GET
我需要找到H10错误的原因,才能让应用程序在Heroku上启动和运行。我联系了他们的支持,但到目前为止他们还没有帮助。
有什么想法可以追踪到可能导致这种情况的原因吗?理想情况下,我拉的日志比我在这里看到的要多。
我没有设置procfile。
heroku pg:info
看起来不错
heroku run rake db:migrate
作品
heroku pg:psql
连接成功
psql -h <hostname> -p 5432 -d <dbname> --username=<username> -w
连接超时(从本地计算机,而不是heroku)
访问网站
应用程序错误应用程序中发生错误,无法提供您的页面。如果您是应用程序所有者,请检查日志以了解详细信息。您可以从Heroku CLI使用命令heroku logs --tail执行此操作

jexiocij

jexiocij1#

我更新了我的web服务器以使用Puma per https://devcenter.heroku.com/articles/getting-started-with-rails5
然后添加了Procfile
与以下

web: bundle exec puma -C config/puma.rb

还有美洲狮

workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup if defined?(DefaultRackup)
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end

网站也恢复了

相关问题