A distinguished Ruby environment manager with the refined approach of a gentleman's butler
🎭 Development Fun: The butler-themed language and refined terminology are just for entertainment during development and will be updated before any real production release, if any.
Ruby Butler selects Ruby, prepares dependencies, and runs commands without changing your shell environment. Bundler is the default package backend. An opt-in native backend resolves and installs gems while retaining RubyGems and Bundler at application runtime. On Linux and macOS, Butler can also install missing Ruby runtimes.
Download the latest production binary for your platform from releases and add to PATH:
curl -L https://github.com/RubyElders/ruby-butler/releases/latest/download/rb-linux -o ~/.local/bin/rb && chmod +x ~/.local/bin/rbcurl -L https://github.com/RubyElders/ruby-butler/releases/latest/download/rb-macos -o ~/.local/bin/rb && chmod +x ~/.local/bin/rbInvoke-WebRequest -Uri "https://github.com/RubyElders/ruby-butler/releases/latest/download/rb-windows.exe" -OutFile "$env:USERPROFILE\AppData\Local\Microsoft\WindowsApps\rb.exe"Install Ruby on Linux or macOS, then check available installations (by default in ~/.rubies):
# Install the latest matching prebuilt CRuby
rb install ruby 4.0
# Survey your distinguished Ruby installations
rb info runtimeRuby Butler composes gem and bundle commands with environmental intelligence:
- In Ruby environments: Respects your Ruby environment selection
- In Bundler environments: Respects Gemfile and applies
bundle execautomatically - Ruby Detection: Honors
.ruby-versionfiles and Gemfile ruby requirements
# Execute with latest Ruby (default behavior)
rb x ruby -v
# Execute with specific Ruby version
rb -r 3.4.5 x ruby -v
# Create a new Rails project with distinguished precision
rb x gem exec rails new butler-test
cd butler-test
# Synchronize bundler environment (handles bundle install)
rb sync
# Launch Rails console in the prepared environment
rb x rails c
# Execute any Ruby command with proper environmental preparation
rb x gem list
rb x rake testUnlike traditional Ruby managers that alter your shell environment, Ruby Butler employs a service-oriented approach:
- No Environment Pollution: Your shell remains pristine—Butler prepares environments per-execution
- Automatic Bundler Integration: Detects Gemfile projects and applies
bundle execintelligently - Intelligent Composition: Combines Ruby installations, gem environments, and bundler projects seamlessly
- Graceful Error Handling: Provides sophisticated guidance when commands or environments are missing
This approach mirrors how a distinguished butler operates: preparing everything behind the scenes, serving with precision, then disappearing without a trace.
Ruby Butler expects Ruby installations in ~/.rubies/ (the standard location for ruby-install and similar tools). It discovers and composes:
- Ruby Runtimes: Installed via
rb install rubyon Linux/macOS, or an external installer on any supported platform - Gem Environments: User gem directories (
~/.gem/ruby/X.Y.Z/) - Bundler Projects: Detected automatically via
Gemfilepresence
Missing Ruby runtimes are installed automatically for sync, exec, and run on Linux/macOS. Disable this with --no-auto-install-ruby, RB_AUTO_INSTALL_RUBY=false, or auto-install-ruby = false in your global config. Native gem compilation still requires a compiler and the gem's system libraries.
rb exec/rb x- Execute commands within meticulously prepared environmentsrb sync/rb s- Synchronize bundler environments (also auto-triggered when needed)rb run/rb r- Execute project scripts defined inrbproject.tomlrb new- Create a minimalrbproject.tomlin the current directoryrb info runtime- Survey your Ruby estate with elegant presentationrb info env- Display current environment compositionrb info project- Show resolved project settingsrb info config- Display merged configuration with sourcesrb install ruby [version]- Install a matching prebuilt CRuby on Linux/macOSrb export-gemfile- Export Gemfile declarations to stdout as TOML (or--format kdl)rb version- Display version informationrb shell-integration bash- Generate bash completions (eval "$(rb shell-integration bash)")
rb.toml- Global configuration file (in~/.config/rb/or~/.rb.toml)rbproject.tomlorgem.toml- Project-level script definitions and metadata
To use native dependency preparation by default, add to your global rb.toml:
package-backend = "native"Use package-backend "native" in KDL. RB_PACKAGE_BACKEND=native selects it for a shell session; --package-backend native selects it for one command. Set it to bundler to switch back. Inspect effective settings with rb info config. See the 0.4.0 changelog for new features, defaults, and limitations.
This is a concept demonstration showcasing a heavily opinionated approach to Ruby environment management.
cargo build --releaseRust Unit & Integration Tests:
cargo testShell Integration Tests (shellspec):
./shellspecPowerShell Integration Tests (Pester):
# Setup once
pwsh tests/Setup.ps1
# Run repeatedly
Invoke-Pester tests/rb-core: Environment detection, composition, and orchestrationrb-cli: Distinguished command-line interface with refined messagingrb-tests: Sophisticated testing utilities for realistic environment simulation
Ruby Butler is built with Rust for cross-platform reliability and employs a environment-agnostic design—no shell modifications required.
If you're curious about what Butler does under the hood, add -v or -V to see the distinguished orchestration in action.
To create a new release with cross-platform binaries:
- Update version in root
Cargo.toml(workspace version), refreshCargo.lock, and update the Ruby helper versions undergems/ - Update CHANGELOG.md with release notes
- Create and push tag:
git tag v1.0.0 git push --tags
The release workflow automatically:
- Builds binaries for Linux, macOS (Apple Silicon), and Windows (both release and debug)
- Creates GitHub release with binaries attached
- Embeds git information in version output (
rb version)
Released binaries include version traceability:
- Tagged builds:
Ruby Butler v1.0.0 - Development builds:
Ruby Butler v0.1.0 (c5156b1) [debug build] [modified]
Distinguished Ruby development deserves distinguished tooling.