This action downloads a prebuilt ruby and adds it to the PATH
.
It is very efficient and takes about 5 seconds to download, extract and add the given Ruby to the PATH
.
No extra packages need to be installed.
Important: Prefer ruby/setup-ruby@v1
.
If you pin to a commit or release, only the Ruby versions available at the time of the commit
will be available, and you will need to update it to use newer Ruby versions, see Versioning.
This action currently supports these versions of MRI, JRuby and TruffleRuby:
Interpreter | Versions |
---|---|
ruby |
1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.4.1, head, debug, mingw, mswin, ucrt |
jruby |
9.1.17.0 - 9.4.11.0, head |
truffleruby |
19.3.0 - 24.1.2, head |
truffleruby+graalvm |
21.2.0 - 24.1.2, head |
ruby-debug
is the same as ruby-head
but with assertions enabled (-DRUBY_DEBUG=1
).
ruby-asan
is the same as ruby-head
but with AddressSanitizer (ASan) enabled, helpful for finding memory issues in native extensions.
Native extensions are automatically compiled with AddressSanitizer when using ruby-asan
.
ruby-asan
is currently only available on ubuntu-24.04
.
Regarding Windows ruby master builds, mingw
is a MSYS2/MinGW build, head
& ucrt
are MSYS2/UCRT64
builds, and mswin
is a MSVC/VS 2022 build.
Preview and RC versions of Ruby might be available too on Ubuntu and macOS (not on Windows).
However, it is recommended to test against ruby-head
rather than previews,
as it provides more useful feedback for the Ruby core team and for upcoming changes.
Only release versions published by RubyInstaller are available on Windows. Due to that, Ruby 2.2 resolves to 2.2.6 on Windows and 2.2.10 on other platforms. Ruby 2.3 on Windows only has builds for 2.3.0, 2.3.1 and 2.3.3.
Note that Ruby ≤ 2.4 and the OpenSSL version it needs (1.0.2) are both end-of-life, which means Ruby ≤ 2.4 is unmaintained and considered insecure.
The action works on these GitHub-hosted runners images. Runner images not listed below are not supported yet. $OS-latest
just alias to one of these images.
Operating System | Supported |
---|---|
Ubuntu | ubuntu-20.04 , ubuntu-22.04 , ubuntu-24.04 , ubuntu-22.04-arm , ubuntu-24.04-arm |
macOS | macos-13 and newer versions |
Windows | windows-2019 , windows-2022 |