繁体   English   中英

无法将 Rails API 应用程序部署到 AWS Elastic Beanstalk

[英]Unable to deploy Rails API app to AWS Elastic Beanstalk

我已经按照 本教程了解了如何将带有 RDS 的 Rails API 部署到 Elastic Beanstalk,直到部署应用程序的最后一步,这一切都在起作用。 每次我尝试部署时,我都会看到运行状况下降并崩溃。 我正在手动部署,而不是使用 AWS EB CLI 工具。 我正在使用 mac。 我检查了日志的最后 100 行,这是我看到的唯一错误:

[ERROR] An error occurred during execution of command [app-deploy] - [stage ruby application]. Stop running the command. Error: install dependencies in Gemfile failed with error Command /bin/sh -c bundle config set --local deployment true failed with error exit status 1. Stderr:rbenv: version `ruby-2.6.1' is not installed (set by /var/app/staging/.ruby-version)

当我尝试部署时,我得到的消息是:

Unsuccessful command execution on instance id(s) 'i-0f99244af00c70eb0'. Aborting the operation.

During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.

Environment health has transitioned from Info to Degraded. Command failed on all instances. Incorrect application version found on all instances. Expected version "Sample Application" (deployment 13). Application update failed 13 seconds ago and took 77 seconds.

我真的需要让它工作,任何帮助将不胜感激!

您必须将.ruby-version文件(有时也在Gemfile )中的 ruby​​ 版本更改为 AWS 文档中的列表之一

https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html#platforms-supported.ruby

现在是2.7.42.6.8但有时会更新 AWS 版本

暂无
暂无

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

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