问题描述
我有一个仅限Rails 6 api的应用程序,但无法在AWS Elastic Beanstalk上运行.部署该应用程序后,puma停留在消息工人提前终止"上.我没有该项目的任何自定义配置或设置.只需创建一个环境并上传已存档的zip文件即可.
I have a Rails 6 api-only application which I am failed to run at AWS Elastic Beanstalk. After deployment of that application, puma stucks with message "Early termination of worker". I don't have any custom configurations nor settings for that project. Simply created an environment and uploaded archived zip file.
使用命令pkill -9 -f puma
杀死puma进程后,我的puma.log文件如下所示:
After I kill puma processes with command pkill -9 -f puma
my puma.log file looks like below:
=== puma startup: 2020-01-22 13:17:45 +0000 ===
=== puma startup: 2020-01-22 13:17:45 +0000 ===
[28858] Early termination of worker
[28856] Early termination of worker
[28862] Early termination of worker
[28865] Early termination of worker
[28869] Early termination of worker
我搜索了该错误,但没有找到解决方法.
I searched that error and found nothing for solve.
- Ruby版本:2.6.5
- 彪马4.3.1版
- 滑轨版本:6.0.2.1
我将Puma与运行在AWS的64位Amazon Linux/2.11.2上的Ruby 2.6结合使用.
I am using Puma with Ruby 2.6 running on 64bit Amazon Linux/2.11.2 on AWS.
推荐答案
遇到相同的错误.原来这是美洲狮的另一种补丁.
Met the same error. Turns out it is a different PATCH of puma.
我从弹性豆茎中使用了这个堆栈
I was using this stack from elastic beanstalk
Ruby 2.6 AL2 version 3.0.1
64bit Amazon Linux 2 v3.0.1 running Ruby 2.6
Ruby 2.6.6-p146
RubyGems 3.1.2
Puma 4.3.3
...
我的项目的Gemfile
以这种方式包含了puma
.
My project's Gemfile
included puma
this way.
gem 'puma', '~> 4.3.3'
我的项目是即将到来的新项目的样板,因此对于旧"项目来说一切都很好,直到更新的补丁版本puma 4.3.5发行为止.
My project was a boilerplate for new projects that were coming my way, so things were working fine for "old" projects until the newer patch version, puma 4.3.5 as of now, came out.
解决方案是将Gemfile中的gem版本固定为:
Solution is to fix the version of the gem in the Gemfile as such:
gem 'puma', '= 4.3.3'
经验教训是,始终将您的环境与部署工具的环境匹配.跟踪最新的解决方案堆栈版本这里.
Lesson learnt is to always match your environment with that of your deployment tool. Keep track of the latest solution stack versions here.
这篇关于彪马(Puma)停留在消息“工人的提前解雇"中仅在Rails 6 API上的项目在Elastic Beanstalk上进行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!