- Home
- Runtime Version Managers
- chruby
chruby
What it is
chruby is a free, MIT-licensed tool for changing the Ruby version selected in a shell. When a version is selected, it updates PATH and sets GEM_HOME and GEM_PATH for that Ruby. It can fuzzy-match installed Ruby versions and falls back to the system Ruby. Optional automatic switching checks the current directory and its parent directories for a .ruby-version file. chruby supports bash 3 or later and zsh. Installation options documented by the project include a release tarball, Homebrew, Arch Linux AUR, Fedora Copr, and FreeBSD ports. The project describes using ruby-install or ruby-build to add Ruby implementations for chruby to manage. Its wiki links usage instructions for Capistrano, Chef, Cron, Emacs, Pow, Puppet, Sudo, Vim, and Fish. Releases are PGP signed, and the README provides instructions for verifying signatures. The README describes the codebase as about 100 lines and says it has tests. chruby does not hook cd or install executable shims, and automatic switching is not on by default.
For and against
For
- Sets PATH, GEM_HOME, and GEM_PATH for selected Ruby
- Can fuzzy-match installed Ruby versions
- Optional .ruby-version directory switching
- Supports bash 3 or later and zsh
Against
- Requires bash 3 or later or zsh
- Automatic switching is not enabled by default
- Does not hook cd or install executable shims
The verdict
chruby provides shell-based Ruby selection with optional directory-based switching. Users who expect automatic switching by default or executable shims should note those limits.
Who it suits
chruby suits Ruby developers who want to select a Ruby version from bash or zsh. It can also fit projects that use .ruby-version files, if the user enables its optional automatic switching.
Plans and prices
Free
MIT licensed · requires bash >= 3 or zsh
Read 9 Oct 2026 · github.com
On the record
- Automatic switching
- Optional auto-switching checks the current and parent directories for a .ruby-version file.github.com · read 9 Oct 2026
- Install options
- The project documents installation from a release tarball, Homebrew, Arch Linux AUR, Fedora Copr, and FreeBSD ports.github.com · read 9 Oct 2026
- Integrations
- The project wiki links usage instructions for Capistrano, Chef, Cron, Emacs, Pow, Puppet, Sudo, Vim, and Fish.github.com · read 9 Oct 2026
- License
- The repository identifies its license as MIT.github.com · read 9 Oct 2026
- Limitations
- chruby does not hook cd, install executable shims, or automatically switch Ruby versions by default.github.com · read 9 Oct 2026
- Path and gems
- It updates PATH and sets GEM_HOME and GEM_PATH for the selected Ruby.github.com · read 9 Oct 2026
- Purpose
- chruby changes the current Ruby version in a shell.github.com · read 9 Oct 2026
- Ruby installers
- The README describes using ruby-install or ruby-build to install additional Ruby implementations for chruby to manage.github.com · read 9 Oct 2026
- Ruby support
- It supports fuzzy matching of installed Rubies and defaults to the system Ruby.github.com · read 9 Oct 2026
- Security
- The README says all releases are PGP signed and gives instructions to verify a release signature.github.com · read 9 Oct 2026
- Shell support
- It supports bash 3 or later and zsh.github.com · read 9 Oct 2026
- Size and tests
- The README describes chruby as about 100 lines of code and says it has tests.github.com · read 9 Oct 2026