Skip to content
actions

GitHub Action

Setup Ruby for use with actions

v1.0.0 Latest version
Use latest version
actions

Setup Ruby for use with actions

Setup a Ruby environment and add it to the PATH

Installation

Copy and paste the following snippet into your .yml file.

- name: Setup Ruby for use with actions
  uses: actions/setup-ruby@v1.0.0
Learn more about this action in actions/setup-ruby
Choose a version

setup-ruby

GitHub Actions status

This action sets up a ruby environment for use in actions by:

  • optionally installing a version of ruby and adding to PATH. Note that this action only uses versions of Ruby already installed in the cache. The action will fail if no matching versions are found.
  • registering problem matchers for error output

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@master
- uses: actions/setup-ruby@v1
  with:
    ruby-version: '2.x' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
- run: ruby hello.rb

Matrix Testing:

jobs:
  build:
    runs-on: ubuntu-16.04
    strategy:
      matrix:
        ruby: [ '2.x', '3.x' ]
    name: Ruby ${{ matrix.ruby }} sample
    steps:
      - uses: actions/checkout@master
      - name: Setup ruby
        uses: actions/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          architecture: 'x64'
      - run: ruby hello.rb

License

The scripts and documentation in this project are released under the MIT License

Contributions

Contributions are welcome! See Contributor's Guide

You can’t perform that action at this time.