⚡️ setup-ruby-flash
Source: Dev.to
Find out how fast my workflows can go!
Overview
A fast GitHub Action for setting up a Ruby environment using rv for Ruby installation and ore for gem management.
- ⚡ Install Ruby in under 2 seconds — no compilation required
- ⚡ Install gems up to 50 % faster with ore
- 🚀 Lightning‑fast Ruby installation via pre‑built binaries from rv
- 📦 Rapid gem installation with ore (Bundler‑compatible)
- 💾 Intelligent caching for both Ruby and gems
- 🔒 Security auditing via ore audit
Supported platforms: Linux & macOS (x86_64 & ARM64) – also works with Gitea, Forgejo, Codeberg, and GitHub Actions.
Requirements
- Operating Systems: Ubuntu 22.04+, macOS 14+
- Architectures: x86_64, ARM64
- Ruby Versions: 3.2, 3.3, 3.4, 4.0
Important
- Windows is not supported (use
ruby/setup-rubyinstead)- Ruby ≤ 3.1 is not supported (use
ruby/setup-rubyinstead)
Features
| Feature | setup‑ruby‑flash | ruby/setup‑ruby |
|---|---|---|
| Ruby install time | ~5 s → < 2 s | ~5 s |
| Gem install speed | ore (~50 % faster) | Bundler |
| Latest stable Ruby | ✅ | ✅ |
| Latest RubyGems | ✅ | ✅ |
| Latest Bundler | ✅ | ✅ |
| Windows support | ✅ | ❌ |
| Ruby < 3.2 | ✅ | ❌ |
| JRuby (planned) | ✅ | ❌ |
| TruffleRuby (planned) | ✅ | ❌ |
| Security audit (ore) | ❌ | ✅ |
Usage
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4' # e.g. 3.4, 3.4.1, or "ruby" for latest stable
ore-install: true # run `ore install` and cache gems
Additional options:
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
ore-install: true
without-groups: 'development,test' # exclude gem groups
The action reads the Ruby version from the following files when ruby-version is omitted:
.ruby-version.tool-versions(asdf format)mise.toml
Inputs
| Input | Description | Default |
|---|---|---|
ruby-version | Ruby version to install (e.g., 3.4, 3.4.1). Use ruby for the latest stable version or omit to read from version files. | default |
rubygems | RubyGems version: default, latest, or a specific version (e.g., 3.5.0). | default |
bundler | Bundler version: Gemfile.lock, default, latest, none, or a specific version. | Gemfile.lock |
ore-install | Run ore install and cache gems. | false |
working-directory | Directory containing version files and Gemfile. | . |
cache-version | Cache version string for invalidation. | v1 |
rv-version | Version of rv to install. | latest |
ore-version | Version of ore to install. | latest |
skip-extensions | Skip building native extensions. | false |
without-groups | Comma‑separated gem groups to exclude. | '' |
ruby-install-retries | Number of retry attempts for Ruby installation (exponential back‑off). | 3 |
token | GitHub token for API calls. | ${{ github.token }} |
Outputs
| Output | Description |
|---|---|
ruby-version | The installed Ruby version |
ruby-prefix | Path to the Ruby installation |
rv-version | The installed rv version |
rubygems-version | The installed RubyGems version |
bundler-version | The installed Bundler version |
ore-version | The installed ore version |
cache-hit | Whether gems were restored from cache |
Example Workflow
name: CI
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
ruby: ['3.2', '3.3', '3.4']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ${{ matrix.ruby }}
ore-install: true
- run: bundle exec rake test
Advanced examples
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
ore-install: true
without-groups: 'development,test'
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ruby
rubygems: latest
bundler: latest
ore-install: true
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
rubygems: '3.5.0'
ore-install: true
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
ore-install: true
skip-extensions: true
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
ore-install: true
working-directory: './my-app'
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4.1'
rv-version: '0.4.0'
ore-version: '0.1.0'
ore-install: true
If you encounter intermittent failures due to GitHub API rate limiting, increase the retry count:
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
ruby-install-retries: '5'
Comparison with ruby/setup-ruby
Before (ruby/setup-ruby)
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- run: bundle exec rake test
After (setup-ruby-flash)
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.4'
ore-install: true
- run: bundle exec rake test
Another example:
# Before
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
rubygems: latest
bundler: latest
# After
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ruby
rubygems: latest
bundler: latest
Credits
- setup-ruby – the long‑standing reference implementation.
- rv – created by the Spinel Cooperative.
- ore – created by Contriboss.
I am a full‑time FLOSS maintainer. If you find my work valuable, consider becoming a sponsor—every dollar helps!
Support
🥰 Support FLOSS work 🥰
Get access to the “Sponsors” channel on the Galtzo FLOSS Discord.