Table of contents


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. We manage this with rbenv.

Setting up rbenv

We set up rbenv differently depending on what’s going on:

  • Interactive login shells: /etc/profile.d/ sets up rbenv
  • Applications: govuk_setenv and a .ruby-version in the app directory set up rbenv
  • Deployment: Capistrano uses a non -login shell so we set default_environment (commit)
  • Testing: Jenkins uses a non-login shell so we add /usr/lib/rbenv/shims to the PATH
  • Cronjobs: some cronjobs start with /bin/bash -l -c which runs a login shell

Add a new Ruby version in puppet

You will need to build a new fpm package with the new Ruby version.