在 AWS Elastic Beanstalk 上部署应用程序时出现 Ruby 版本错误

问题描述 投票:0回答:1

我正在尝试在 AWS Elastic Beanstalk 上部署 Ruby on Rails 应用程序。我收到以下错误 -

ERROR: [Instance: <Instance ID>] Command failed on instance. Return code: 18 Output: (TRUNCATED)...e ']'
+ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Your Ruby version is 2.4.3, but your Gemfile specified 2.3.3.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) '<Instance ID>'. Aborting the operation.
ERROR: Failed to deploy application.

收到此错误后,我已从 Gemfile 中删除了 ruby 版本号,但仍然收到此错误。

之后,我在新的 Beanstalk 环境中部署了应用程序,而没有在 Gemfile 中提及 Ruby 版本。但我仍然遇到同样的错误。

ruby-on-rails ruby amazon-web-services amazon-elastic-beanstalk
1个回答
0
投票

我之前的答案已被删除,因为我对另一个有关过时且不安全版本的 Ruby 问题的问题给出了类似的答案,但我将重申我向任何使用不安全版本的 Ruby(如 2.4)遇到错误的人提供的相同建议。 3:更新到3+或至少2.7以及相应兼容的Bundler版本。

管理员注意:如果此答案值得删除,请也删除此问题并要求用户使用支持的 Ruby 版本重新发布。

© www.soinside.com 2019 - 2024. All rights reserved.