繁体   English   中英

Rails-彪马随机未能启动工人

[英]Rails - Puma randomly failed to start a worker

从独角兽升级到美洲豹后,我遇到了一个奇怪的错误;

有时,当工作人员开始工作时,他们会从不良的红宝石版本开始工作,因此会导致错误。 似乎是随机的...

此错误在我的应用程序上导致503,因为工作程序无法正确启动。

这是我的错误:

app[web.3]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma)
app[web.3]: SignalException: SIGTERM

但我不喜欢红宝石2.5.0

系统配置:

Ruby版本:2.5.1

Rails版本:5.1.4

Puma版本:3.11.4

(在heroku上)

有人有主意吗?

编辑:

Procfile

web: bundle exec puma -C config/puma.rb
worker:  bundle exec rake jobs:work
shoryuken_worker:  bundle exec shoryuken -R -C config/shoryuken.yml

puma.rb

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

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RAILS_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

gem 'puma' Gemfilegem 'puma'

Gemfile.lockpuma (3.11.4)

将答案发布在此处,供尚未解决此问题的任何人使用。

heroku config:set "BUNDLE_DISABLE_EXEC_LOAD"="true"

看到这个线程: github puma问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM