首页 > 解决方案 > 在 AWS Elastic Beanstalk 上部署应用程序时出现 Ruby 版本错误

问题描述

我正在尝试在 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-railsrubyamazon-web-servicesamazon-elastic-beanstalk

解决方案


推荐阅读