Use Ruby Version task
Azure DevOps Services
Use this task to select a version of Ruby to run on an agent, and optionally add it to PATH.
Demands
None
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. Available Ruby versions on Microsoft-hosted agents can be found here.
YAML snippet
# Use Ruby version
# Use the specified version of Ruby from the tool cache, optionally adding it to the PATH
- task: UseRubyVersion@0
inputs:
#versionSpec: '>= 2.4'
#addToPath: true # Optional
Arguments
| Argument | Description |
|---|---|
versionSpecVersion spec |
(Required) Version range or exact version of a Ruby version to use. Default value: >= 2.4 |
addToPathAdd to PATH |
(Optional) Whether to prepend the retrieved Ruby version to the PATH environment variable to make it available in subsequent tasks or scripts without using the output variable. Default value: true |
If the task completes successfully, the task's output variable will contain the directory of the Ruby installation.
Open source
This task is open source on GitHub. Feedback and contributions are welcome.
FAQ
Where can I learn more about tool installers?
For an explanation of tool installers and examples, see Tool installers.
Do I need an agent?
You need at least one agent to run your build or release.
I'm having problems. How can I troubleshoot them?
See Troubleshoot Build and Release.
I can't select a default agent pool and I can't queue my build or release. How do I fix this?
See Agent pools.
My NuGet push task is failing with the following error: "Error: unable to get local issuer certificate". How can I fix this?
This can be fixed by adding a trusted root certificate. You can either add the NODE_EXTRA_CA_CERTS=file environment variable to your build agent, or you can add the NODE.EXTRA.CA.CERTS=file task variable in your pipeline. See Node.js documentation for more details about this variable. See Set variables in a pipeline for instructions on setting a variable in your pipeline.
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 instructions here. The tool name to use is "Ruby."
Maklum balas
Kirim dan lihat maklum balas untuk