【问题标题】:Opsworks : Rails App Layer : specify Ruby minor versionOpsworks:Rails App Layer:指定 Ruby 次要版本
【发布时间】:2015-02-17 20:57:59
【问题描述】:

我想将我的 opsworks rails 层固定到 ruby​​ 版本 2.1.2 显然,这些层已升级到 2.1.5,现在我无法再部署我的应用了。

我试图通过将自定义 json 添加到我的堆栈中来解决此问题,如下所示:

"opsworks": {
       "ruby": {
              "full_version": "2.1.2"
        }
   }

我也试过这个:

"ruby": {
       "full_version": "2.1.2",
       "major_version": "2.1",
       "minor_version": "1"
   }

部署失败的错误消息:

[2014-12-18T22:36:58+00:00] INFO: Running queued delayed notifications before re-raising exception
[2014-12-18T22:36:58+00:00] ERROR: Running exception handlers
[2014-12-18T22:36:58+00:00] ERROR: Exception handlers complete
[2014-12-18T22:36:59+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2014-12-18T22:36:59+00:00] ERROR: deploy[/srv/www/carlingo] (deploy::rails line 65) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '18'
---- Begin output of sudo su - deploy -c 'cd /srv/www/carlingo/releases/20141218223651 && /usr/local/bin/bundle install --path /home/deploy/.bundler/carlingo --without=test development' 2>&1 ----
STDOUT: Your Ruby version is 2.1.5, but your Gemfile specified 2.1.2
STDERR:

【问题讨论】:

    标签: ruby amazon-web-services version aws-opsworks


    【解决方案1】:

    啊哈,我想我从一些老医生那里得到了一些建议。

    通过阅读aws/opsworks code,我将自定义 json 更正为:

    "ruby": {
           "version": "2.1.2"
       }
    

    它成功了!

    实际上,这只是部分正确答案。

    我有一个堆栈对此做出响应并正确降级,而另一个堆栈不会降级我的 ruby​​ 版本,它在“update_dependencies”上报告此问题,并在部署时继续失败。

    Userspace Ruby version is up-to-date (2.1) 
    

    只有我登录时的版本是 2.1.5。

    后来许多重新部署和更新依赖项最终都更新了。

    【讨论】:

      【解决方案2】:

      现在看起来正确的文档在这里:

      http://docs.aws.amazon.com/opsworks/latest/userguide/attributes-json-opsworks-other.html#attributes-json-opsworks-ruby-version

      这表示要像这样指定“opsworks”:“ruby_version”和“ruby”:“patch_version”:

      {
        "opsworks": {
          "ruby_version": "2.2"
        },
        "ruby": {
          "patch_version": "3"
        }
      
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-04
        • 1970-01-01
        • 1970-01-01
        • 2012-08-03
        • 2015-04-30
        • 1970-01-01
        • 2021-09-01
        相关资源
        最近更新 更多