AWS elastic beanstalk 没有获取环境变量

AWS elastic beanstalk is not getting the environment variables

我正在尝试 运行 AWS Elastic Beanstalk 上的 Rails 6 应用程序,但我从 puma 日志中得到以下信息(每隔几秒重复一次)

[21776] + Gemfile in context: /var/app/current/Gemfile
[21776] Early termination of worker

版本号:

服务器在实例外部没有响应,log/production.log 上没有任何内容。

运行 在 production 模式下的开发机器上没有错误,并且数据库可以访问(没有迁移失败)。

运行 在 AWS 实例上命令 bundle exec puma -p 3000 -e production 我得到

Puma starting in single mode...
Version 4.3.5 (ruby 2.7.1-p83), codename: Mysterious Traveller
Min threads: 5, max threads: 5
Environment: production
Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

所以没有明显的错误可能会导致 worker 停止。

我如何找出导致工人失败的原因?

编辑 1:

我在实例上 运行 Rails 控制台,发现缺少环境变量 - 例如生产数据库 user/pass/host。一旦我对它们进行硬编码,我就可以连接到数据库。 我怀疑缺少其他环境变量导致应用程序崩溃。

AWS 论坛上的一位用户the answer

在我的 Gemfile 中设置

gem "nio4r", "= 2.5.2"

已解决问题。