Skip to content

Latest commit

 

History

History
166 lines (123 loc) · 6.32 KB

use-ruby-version-v0.md

File metadata and controls

166 lines (123 loc) · 6.32 KB
title description ms.date monikerRange
UseRubyVersion@0 - Use Ruby version v0 task
Use the specified version of Ruby from the tool cache, optionally adding it to the PATH.
07/02/2024
>=azure-pipelines-2019

UseRubyVersion@0 - Use Ruby version v0 task

:::moniker range=">=azure-pipelines-2019"

Use this task to select a version of Ruby to run on an agent. Optionally, the task can add the Ruby version to PATH.

:::moniker-end

Syntax

:::moniker range=">=azure-pipelines-2019.1"

# Use Ruby version v0
# Use the specified version of Ruby from the tool cache, optionally adding it to the PATH.
- task: UseRubyVersion@0
  inputs:
    versionSpec: '>= 2.4' # string. Required. Version spec. Default: >= 2.4.
    #addToPath: true # boolean. Add to PATH. Default: true.

:::moniker-end

:::moniker range="=azure-pipelines-2019"

# Use Ruby Version v0
# Retrieves the specified version of Ruby from the tool cache. Optionally add it to PATH.
- task: UseRubyVersion@0
  inputs:
    versionSpec: '>= 2.4' # string. Required. Version spec. Default: >= 2.4.
    #addToPath: true # boolean. Add to PATH. Default: true.

:::moniker-end

Inputs

:::moniker range=">=azure-pipelines-2019"

versionSpec - Version spec
string. Required. Default value: >= 2.4.

Specifies the version range or a version of a Ruby version to use.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

addToPath - Add to PATH
boolean. Default value: true.

Optional. Prepends the retrieved Ruby version to the PATH environment variable to make it available in subsequent tasks or scripts without using the output variable.


:::moniker-end

Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

:::moniker range=">=azure-pipelines-2019"

This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.

rubyLocation
The resolved folder of the Ruby distribution.

:::moniker-end

Remarks

Use this task to select a version of Ruby to run on an agent, and optionally add it to PATH.

Prerequisites

  • A Microsoft-hosted agent with side-by-side versions of Ruby installed, or a self-hosted agent with Agent.ToolsDirectory configured (see FAQ).

This task will fail if no Ruby versions are found in Agent.ToolsDirectory. See other available Ruby versions on Microsoft-hosted agents.

Where can I learn more about tool installers?

For an explanation of tool installers and examples, see Tool installers.

How can I configure a self-hosted agent to use this task?

You can run this task on a self-hosted agent with your own Ruby versions. To run this task on a self-hosted agent, set up Agent.ToolsDirectory by following the Tool Cache instructions. The tool name to use is Ruby.

Requirements

:::moniker range=">=azure-pipelines-2022"

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions This task runs using the following command restrictions: restricted
Settable variables This task has permission to set the following variables: rubyLocation, PATH
Agent version 2.182.1 or greater
Task category Tool

:::moniker-end

:::moniker range=">=azure-pipelines-2019 <=azure-pipelines-2020.1"

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.115.0 or greater
Task category Tool

:::moniker-end

See also