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

tv6aics1  于 11个月前  发布在  Ruby
关注(0)|答案(1)|浏览(150)

我正在尝试在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版本。但我仍然得到同样的错误。

egmofgnx

egmofgnx1#

我之前的回答被删除了,因为我对另一个关于过时和不安全的Ruby版本的问题给出了类似的回答,但我将重申我对任何使用不安全的Ruby版本(如2.4.3)遇到错误的人的给予的相同建议:更新到3+或至少2.7以及相应的兼容Bundler版本。
管理员注意:如果这个答案值得删除,请删除这个问题,并要求用户使用支持的Ruby版本重新发布。

相关问题