ruby-version-manager
Use at session start for Ruby projects (Gemfile, .ruby-version, or .tool-versions present). Detect version manager BEFORE running ruby, bundle, gem, rake, rails, rspec, or any Ruby command.
What this skill does
# Ruby Version Manager Skill
Detects and configures Ruby version managers for proper environment setup.
## When to Use
**Run detect.sh IMMEDIATELY when:**
- Starting work in a directory with `Gemfile`, `.ruby-version`, or `.tool-versions`
- Before your first Ruby command (`ruby`, `bundle`, `gem`, `rake`, `rails`, `rspec`, etc.)
- When switching between Ruby projects
**Do NOT wait** for commands to fail or user requests. Proactive detection prevents version mismatch errors.
**Always chain activation with commands:** `ACTIVATION_COMMAND && ruby_command`
## Usage
### Step 1: Run detect.sh
Run `detect.sh` from this skill's directory (path provided by session-start hook).
### Step 2: Parse Output
The script outputs key=value pairs:
```text
VERSION_MANAGER=rbenv
PROJECT_RUBY_VERSION=3.2.0
VERSION_AVAILABLE=true
ACTIVATION_COMMAND=eval "$(rbenv init -)"
```
### Step 3: Execute Ruby Commands
Chain `ACTIVATION_COMMAND` with your Ruby command:
```bash
eval "$(rbenv init -)" && bundle install
eval "$(rbenv init -)" && bundle exec rspec
```
Run detect.sh once per project session; reuse `ACTIVATION_COMMAND` for subsequent commands.
## Output Variables
| Variable | Description |
|----------|-------------|
| `VERSION_MANAGER` | Detected: shadowenv, chruby, rbenv, rvm, asdf, rv, mise, or none |
| `VERSION_MANAGER_PATH` | Installation path |
| `PROJECT_RUBY_VERSION` | Version required by project |
| `PROJECT_VERSION_SOURCE` | Source file (.ruby-version, .tool-versions, .mise.toml, Gemfile) |
| `RUBY_ENGINE` | Implementation (ruby, truffleruby, jruby) |
| `INSTALLED_RUBIES` | Comma-separated available versions |
| `VERSION_AVAILABLE` | true/false - whether requested version is installed |
| `ACTIVATION_COMMAND` | Shell command to activate the manager |
| `SYSTEM_RUBY_VERSION` | System Ruby (when VERSION_MANAGER=none) |
| `WARNING` | Environment warnings |
| `NEEDS_USER_CHOICE` | true when multiple managers detected without preference |
| `AVAILABLE_MANAGERS` | List of detected managers (when NEEDS_USER_CHOICE=true) |
| `NEEDS_VERSION_CONFIRM` | true when no version specifier found |
| `SUGGESTED_VERSION` | Latest installed Ruby (when NEEDS_VERSION_CONFIRM=true) |
## Activation Commands by Manager
| Manager | Activation Command | Notes |
|---------|-------------------|-------|
| rbenv | `eval "$(rbenv init -)"` | Or use `rbenv exec ruby ...` |
| chruby | `source .../chruby.sh && chruby <version>` | detect.sh provides full command |
| rvm | `source "$HOME/.rvm/scripts/rvm"` | Or use `~/.rvm/bin/rvm-auto-ruby` |
| asdf (v0.16+) | None | `asdf exec ruby ...` |
| asdf (<v0.16) | `source "$HOME/.asdf/asdf.sh"` | Then `asdf exec ruby ...` |
| mise | None | `mise x -- ruby ...` |
| rv | None | `rv ruby run -- ...` |
| shadowenv | None | `shadowenv exec -- ruby ...` |
| none | None | `ruby ...` (uses PATH) |
## Commands Requiring Activation
| Category | Commands |
|----------|----------|
| Core | `ruby`, `irb`, `gem`, `bundle`, `bundler` |
| Build/Task | `rake`, `rails`, `thor` |
| Testing | `rspec`, `minitest`, `cucumber` |
| Linting | `rubocop`, `standardrb`, `reek` |
| LSP/IDE | `ruby-lsp`, `solargraph`, `steep` |
| Debug | `pry`, `byebug`, `debug` |
| Gem binaries | Any executable from `gem install` or Gemfile |
## Handling Special Cases
### Multiple Version Managers (NEEDS_USER_CHOICE=true)
Ask the user which manager to use, then store preference:
```bash
/path/to/set-preference.sh chruby # Saves to ~/.config/ruby-skills/preference.json
```
Detection priority: shadowenv > chruby > rbenv > rvm > asdf > rv > mise > none
### No Version Specifier (NEEDS_VERSION_CONFIRM=true)
Ask: "No .ruby-version found. Use Ruby [SUGGESTED_VERSION] for this session?"
If declined, show options from INSTALLED_RUBIES.
### Version Not Installed (VERSION_AVAILABLE=false)
Inform user and offer installation:
> Ruby {PROJECT_RUBY_VERSION} is not installed. Install with:
> - **rbenv:** `rbenv install {VERSION}`
> - **rvm:** `rvm install {VERSION}`
> - **asdf:** `asdf install ruby {VERSION}`
> - **mise:** `mise install ruby@{VERSION}`
> - **chruby:** `ruby-install ruby {VERSION}`
**Always ask before installing.** For chruby, check INSTALLED_RUBIES for compatible versions (same major.minor).
### Shadowenv Trust Issues
If "untrusted shadowenv program" error appears, user must run `shadowenv trust` in the project directory.
### Version Format Variations
Supported formats: `3.3.0`, `ruby-3.3.0`, `truffleruby-21.3.0`, `3.3.0-rc1`, `3.3` (matches any patch)
### CI/Docker Environments
When VERSION_MANAGER=none, use system Ruby directly.
## Troubleshooting
If Ruby commands fail after activation:
1. Re-run detect.sh to verify environment
2. Check `VERSION_AVAILABLE` - install if false
3. Verify manager installation at `VERSION_MANAGER_PATH`
4. **chruby:** Check `~/.rubies` or `/opt/rubies` for installations
5. **rvm:** Check both `~/.rvm` and `/usr/local/rvm`
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.