Add a new Ruby version
The Ruby language is a core part of GOV.UK - most of our applications are written in it.
Managing different versions of Ruby
Each app can use whatever version of Ruby it wants. For development purposes we manage this locally with rbenv, and when apps are deployed they are built with a container that uses the requested version.
Setting up rbenv
We set up rbenv differently depending on what’s going on:
- Interactive login shells:
/etc/profile.d/rbenv.shsets up rbenv
.ruby-versionin the app directory set up rbenv
Updating the Ruby version in apps
Automatically raising PRs
For applications, you will usually need to change the ruby version in two places - in .ruby-version (which is used by rbenv), and in Dockerfile (which is used during deployment)
Manually raising a PR
You can also create your own branch, update the two files as above, and raise a PR.
Updating individual applications
For each application a PR is raised for (either manually or via bulk-changer), you should test the changes before merge, as follows:
- Most apps will run a test suite through CI. You should check the output of this for any Ruby deprecation warnings. If there are any warnings, they should be fixed.
- Next, you should deploy the updated branch of the app to Integration, and manually test its features to ensure that the new Ruby version hasn’t broken the app.
- It’s worth checking the logs for deprecation warnings at this point (and fixing them), in case there are warnings that weren’t flagged by the test suite run.
- Next, check our monitoring tools
- The PR should be safe to merge.