本文介绍了在Elastic Beanstalk上升级Ruby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在ELB上设置和更新ruby版本?

How does ruby version get set and updated on ELB?

我已经在我们的质量保证中使用ruby 2.2.2,并且分阶段进行了env大约8个月了.我只是在星期一设置了我们的生产环境,它不会部署,因为它说ruby设置为2.2.3,而我的gemfile是2.2.2.我进行了更新和重新部署,一切似乎都很好.

I've been using ruby 2.2.2 on our qa and staging env's for about 8 months now. I just setup our production env Monday and it wouldn't deploy as it said ruby was set to 2.2.3 and my gemfile said 2.2.2. I updated and redeployed and everything seemed to be fine.

我回到了qa/staging env,无法将其更新到ruby 2.2.3.保持说ruby版本是2.2.2,而Gemfile是2.2.3

I came back to the qa/staging env's and can't get it to update to ruby 2.2.3. Kept saying ruby version is 2.2.2 and Gemfile is 2.2.3

我通过elb ui升级了:

I upgraded (through elb ui):

64bit Amazon Linux 2015.03 v1.3.1 running Ruby 2.2 (Passenger Standalone)

64bit Amazon Linux 2015.09 v2.0.6 running Ruby 2.2 (Passenger Standalone)

现在它说Your Ruby version is 2.2.3, but your Gemfile specified 2.2.2.必须有一种更简单的方法来做到这一点.

Now it says Your Ruby version is 2.2.3, but your Gemfile specified 2.2.2. There has to be an easier way to do this.

推荐答案

由于要同时更新平台和版本标签,因此您始终可以使用UpdateEnvironment API来指定解决方案堆栈名称和版本标签参数.

Since you want to update both the platform and the version label at the same time you can always use the UpdateEnvironment API specifying both the solution stack name and version label parameters.

http://docs.aws.amazon.com/elasticbeanstalk/Latest/api/API_UpdateEnvironment.html

您可以使用aws cli或sdk执行此操作.

You can use the aws cli or sdk to do this.

  • 更新Gemfile以匹配新平台上的ruby版本
  • 压缩代码库(包括.elasticbeanstalk和.ebextensions),
  • 通过应用程序版本(AWS控制台-> EB->所有应用程序->应用程序版本)上载到Elb
  • 运行aws elasticbeanstalk update-environment --environment-name "corresponding_env_name" --solution-stack-name "64bit Amazon Linux 2015.09 v2.0.6 running Ruby 2.2 (Passenger Standalone)" --version-label "zip_name_you_uploaded"
  • 一切都正确部署
  • 喝点啤酒.
  • Update Gemfile to match ruby version on new platform
  • Zip up codebase (including .elasticbeanstalk and .ebextensions),
  • Upload to elb through application versions (AWS Console -> EB -> All applications -> Application Versions)
  • Run aws elasticbeanstalk update-environment --environment-name "corresponding_env_name" --solution-stack-name "64bit Amazon Linux 2015.09 v2.0.6 running Ruby 2.2 (Passenger Standalone)" --version-label "zip_name_you_uploaded"
  • Everything deployed correctly
  • Drink some beer.

这篇关于在Elastic Beanstalk上升级Ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:37