TeamCity On-Premises 2024.07 Help

Ruby Environment Configurator

The Ruby environment configurator build feature passes the Ruby interpreter to all build steps. It (1) adds the selected Ruby interpreter and gems bin directories to the system PATH environment variable and (2) configures other necessary environment variables in case of the RVM interpreter.

Example Use Case

For example, this feature allows using commands like ruby, rake, gem, bundle in the Command Line build runner. Thus, if you want to install gems before launching the Rake build runner, you need to add the Command Line build step which launches a custom script. Example:

gem install rake --no-ri --no-rdoc gem install bundler --no-ri --no-rdoc

Ruby Environment Configurator Settings

Option

Description

Ruby interpreter path

The path to the Ruby interpreter. If not specified, the interpreter will be searched in PATH. In this field, you can use values of environment and system variables.

Example:

%\env.I_AM_DEFINED_IN_BUILDAGENT_CONFIGURATION%

RVM interpreter

The RVM interpreter name and, optionally, a gemset configured on a build agent.

The interpreter name cannot be empty. If gemset is not specified, the default one will be used.

This option can be used if you do not want to use the .rvmrc settings: for instance, to run tests on different Ruby interpreters instead of those defined in the .rvmrc file.

RVM with .rvmrc file

The path to the .rvmrc file relative to the checkout directory. If specified, TeamCity will fetch environment variables using rvm-shell and pass them to all build steps.

Fail build if Ruby interpreter wasn't found

Enabling it will fail a build in case the Ruby environment configurator cannot pass the Ruby interpreter to the step execution environment, because the interpreter hasn't been found on the agent.

Last modified: 18 September 2024