Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade Ruby on Elastic Beanstalk

How does ruby version get set and updated on ELB?

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.

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

I upgraded (through elb ui):

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

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

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.

like image 477
Scott Avatar asked Feb 04 '16 14:02

Scott


1 Answers

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

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

Step-By-Step as described by @Scott:

  • 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.
like image 168
Rohit Banga Avatar answered Sep 19 '22 12:09

Rohit Banga