Upgrade Ruby on Elastic Beanstalk

Upgrade Ruby on Elastic Beanstalk

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.

Upgrade Ruby version while deploying to EB

Elastic Beanstalk sets the Ruby version in the Platform (you can think of this as the base AMI). To upgrade this you'll need to update your platform version.

Depending on the web server you use, it sounds like you'll need one of:

  • 64bit Amazon Linux 2018.03 v2.8.7 running Ruby 2.5 (Puma)
  • 64bit Amazon Linux 2018.03 v2.8.7 running Ruby 2.5 (Passenger Standalone)

Upgrade Ruby on Python Elastic Beanstalk instance

For anyone that have the same question and haven't yet resolved it.

packages:
yum:
ruby22: []
ruby22-devel: []
container_commands:
01-set_ruby22:
command: "alternatives --set ruby /usr/bin/ruby2.2"
02-install_sass:
command: "gem install sass"

First, via yum we install the latest supported version of Ruby and Ruby Devel (I prefer 2.4, but the question is for 2.2), after, via container_commands, we set the current ruby version to the latest one, and later we install sass

I prefix the mumbers because it tells to container commands the order in which I need to run each command.

AWS Elastic Beanstalk - How To Upgrade Existing Environment from Ruby 2.1 to Ruby 2.2

I found a solution for this, by using the aws cli (NOT the eb cli):

aws elasticbeanstalk update-environment --solution-stack-name "64bit Amazon Linux 2016.03 v2.1.0 running Ruby 2.3 (Puma)" --environment-name "dev-bg-123456" --region "us-east-1"

The aws cli can be installed with homebrew:

brew install awscli

How to apply a ruby version patch in elastic-beanstalk

You can set in your gemfile the ruby version, for example:

ruby "2.0.0"

Or, if you want to set the engine, engine_version and etc:

ruby "1.9.3", :engine => "jruby", :engine_version => "1.7.8"

So basically you should change the version according to your need.
Take a look on the complete list of the ruby versions here

I hope this helps.

Can I use Ruby version 2.1.2 with Amazon Elastic Beanstalk?

Currently AWS only supports Ruby 1.8.7, 1.9.3, and 2.0.0 from the pre-configured environment types. However you can customise your own AMI to deploy to your Beanstalk application.

More information here:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.customenv.html



Related Topics



Leave a reply



Submit