This feature is experimental: expect things to break and documentation to be innacurate and change inadvertantly. Use at your own risks.
  • language

Ruby Official documentation

Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

Multiple versions of Ruby (and gems) can be installed with rbenv. The various versions are globally available in /opt/rbenv.

Examples

  • System only

    services:
      ruby: '*'
    
    configuration:
      ruby:
        gems:
          - rails
          - compass
    

    We are installing here the default version of Ruby available on the system via the package manager (apt), and install globally the gems rails and compass

  • Single custom version

    services:
      ruby: '*'
    
    configuration:
      ruby:
        versions:
          1.9.3-p551: {}
        gems:
          - compass
    

    We are installing here both the default version of Ruby available on the system via the package manager (apt), and the version 1.9.3-p551. We install as well compass using the system version of Ruby, but install no extra gems with the 1.9.3-p551 version.

  • Multiple custom versions

    services:
      ruby: '*'
    
    configuration:
      ruby:
        versions:
          1.9.3-p551:
            gems:
              - rails
          2.0.0-p598:
            gems:
              - rails
    

    We are installing here the default version of Ruby available on the system via the package manager (apt), as well as 2 extra versions of Ruby (1.9.3-p551 and 2.0.0-p598). No gems are installed for the system version of Ruby, but rails is installed for both extra versions of Ruby.

Plugins of rbenv

The following rbenv plugins are installed to ease the overall experience:

  • ruby-build: is used to build the requested versions of Ruby

Since the Ruby versions are built from source, the sync operation may take longer than expected and depends on the computing power of the your server.

Commands

devops ruby gems add
Add Ruby gems globally

Options

Name Type Description Required
gems array List of gems (string) to add. Required
ruby_version string Version of Ruby the gems should be installed to. The version of Ruby should be installed on the system already.
devops ruby gems remove
Remove Ruby gems globally

Options

Name Type Description Required
gems array List of gems (string) to remove Required
ruby_version string Version of Ruby the gem should be removed from. The version of Ruby should be installed on the system.
devops ruby versions list
List installed versions of Ruby in rbenv
devops ruby versions list available
List available versions of Ruby (installable in rbenv)
devops ruby versions add
Add versions of Ruby (need to be installable)

Options

Name Type Description Required
versions array List of Ruby versions to install. Required
devops ruby versions remove
Remove versions of Ruby (available in rbenv)

Options

Name Type Description Required
versions array List of Ruby versions to install. Required

Configuration

gems array
List of gems to install globally on the system.
versions object
Dictionary of Ruby versions to install in addition to the system version of Ruby. The `keys` are the Ruby versions to install, the `values` are either an empty object `{}` to only install the Ruby version without extra gems, or an object with a `gems` attribute that lists the gems to install.
Default: [object Object]