Ruby 3 on Stack v6


Engine Yard's Stack v6 supports Ruby 3, though at this time it is not a selectable option for the Ruby version when creating or editing an environment. It must instead be set as the Ruby version in use via the environment's Environment Variables.

  • For details on how to set Environment Variables please see this related article.
  • For details on the Environment Variables available to be set please see this readme.

Setting the Ruby version

In the specific case of Ruby 3, the Environment Variable to set is EY_RUBY_VERSION and this can be set to the either a stable version (e.g. 3.0) or a specific version (e.g. 3.1.0-preview1), as required.

The version set on the Edit Environment page will then be overruled, so can be left set to the existing value.

Installing and utilising the new Ruby

Installation of the new Ruby version should be handled before deployment of the application release requiring it. To install the new Ruby version an Apply should be run on the environment. The version can then be checked via ruby -v on the instance(s).

To utilise the new version processes must be restarted. An application deployment only refreshes application workers (Unicorn, Passenger & Puma), so a full restart is needed for the new Ruby version to be utilised. To do this, on all application instances, a sudo monit restart all -g [groupname] should be issued, where [groupname] is found by running sudo cat /etc/monit.d/[unicorn/passenger/puma]_[appname] (dependent on the application server in use). Background workers should be being handled by deploy hooks, so should be restarted as part of the deploy in the next step, but can also be restarted manually via Monit on all applicable instances if required.

Once the application workers are running under the new Ruby version, the new release of the application can be deployed. Ruby 3 requires a higher version of the Engine Yard Serverside gem (which handles the instance side deployment) than the platform uses by default. To utilise the newer version either:

  • If deploying via the UI, click more opts by the Deploy button and lock the Serverside Version to 3.0.3.
  • If deploying via the ey-core CLI, append the -S 3.0.3 argument to the ey-core deploy command, after upgrading the ey-core gem to the latest version.






Please sign in to leave a comment.

Powered by Zendesk