【问题标题】:I would like to see the rails application in elastic beanstalk, but I can be angry at the ruby ​version我想在 elastic beanstalk 中看到 rails 应用程序,但我可能会对 ruby​​ 版本感到愤怒
【发布时间】:2019-10-31 01:46:24
【问题描述】:

我想在 elastic beanstalk 中看到 rails 应用程序,但我可能对 ruby​​ 版本感到愤怒。 但是,在任何地方都找不到 2.4.1 的描述。 你觉得什么样的问题?

Creating application version archive "xxx".
Uploading xxx.zip to S3. This may take a while.
Upload Complete.
2019-06-17 12:33:43    INFO    Environment update is starting.
2019-06-17 12:33:49    INFO    Deploying new version to instance(s).
2019-06-17 12:33:57    ERROR   [Instance: xxx] 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.6.3, but your Gemfile specified 2.4.1.
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.
2019-06-17 12:33:57    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-06-17 12:33:57    ERROR   Unsuccessful command execution on instance id(s) 'xxx'. Aborting the operation.
2019-06-17 12:33:57    ERROR   Failed to deploy application.
ruby '2.6.3'

本地红宝石版本 ruby 2.6.3p62(2019-04-16 修订版 67580)[x86_64-darwin18]

弹力豆茎 Puma 与 Ruby 2.6 在 64 位 Amazon Linux/2.9.5 上运行

【问题讨论】:

    标签: ruby-on-rails amazon-web-services amazon-elastic-beanstalk


    【解决方案1】:

    Elastic Beanstalk 实例设置为使用 Ruby 2.6,但在应用程序根目录的 Gemfile 中,您有如下一行:

    # Gemfile
    
    ruby '2.4.1'
    

    声明您使用的是 Ruby 2.4.1。

    您需要在 Gemfile 中将 Ruby 版本更改为“2.6.3”并重新运行 bundle install 以更新 Gemfile.lock 版本,或者您需要使用 Ruby 2.4 版本平台重新创建 Elastic Beanstalk 环境.如果您重新创建 Elastic Beanstalk 环境,他们可能会使用 Ruby 2.4 的不同补丁版本,因此您可能必须更新 Gemfile 以匹配 Elastic Beanstalk 正在使用的 Ruby 版本。

    【讨论】:

    • 我了解原因。 github master上的资料是2.4.1。我在Gemfile中使用了ruby 2.6.3,但是没有提交给master,是EB看到2.4.1的行为。谢谢你的提示!
    • 你确定你没有列出两次 Ruby 版本,一次是 2.4.1,一次是 2.6.3?
    猜你喜欢
    • 2016-02-03
    • 2017-11-28
    • 2019-07-24
    • 2013-12-18
    • 2020-09-22
    • 2014-09-08
    • 2014-12-05
    • 2015-03-05
    • 2010-12-20
    相关资源
    最近更新 更多