Skip to content

rbenv

A tool that switches between Ruby versions per project on Unix-like systems.

Stars
16.7k
Forks
1.4k
Licence
MIT
Language
Shell
Last update
4 months ago
Type
Dev tool

What it is

rbenv is a version manager for the Ruby programming language on Unix-like systems such as macOS and Linux. It lets one computer keep several Ruby versions installed and picks the right one for each project, based on a .ruby-version file in the project folder. It is used so each project runs on the Ruby version it expects.

  • Run rbenv local 3.1.2 in a project folder to pin that project to a Ruby version
  • Set a machine-wide default Ruby with rbenv global
  • Install a Ruby version with rbenv install 3.1.2 after the ruby-build plugin is present
  • List installed versions with rbenv versions to see which one is active

Great for

  • Developers who work on several Ruby projects that need different Ruby versions
  • People on macOS or Linux who want Ruby versions installed under their home directory
  • Teams that commit a .ruby-version file so everyone uses the same Ruby
  • Users who want a small, simple tool and are willing to add plugins for extra features

Not ideal for

  • Windows users, since the README says it is for Unix-like systems (use a Windows-specific tool instead)
  • People who only ever use one Ruby version and do not need switching
  • Users who want rbenv install to work out of the box, since it needs the separate ruby-build plugin
Step-by-step guide: how to use rbenvInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Homebrew (recommended on macOS or Linux), or git for a manual checkout · A shell such as bash or zsh

    Install with Homebrew (macOS or Linux)

    brew install rbenv

    Set up your shell to load rbenv

    rbenv init
  2. 2

    Run it

    • Install rbenv with your package manager or a git checkout
    • Run rbenv init and open a new terminal
    • Install the ruby-build plugin if rbenv install is missing, then run rbenv install 3.1.2
    • Set a version with rbenv global 3.1.2 or rbenv local 3.1.2
  3. 3

    Get the most out of it

    • Put a .ruby-version file in each project so the right Ruby is picked automatically
    • Use rbenv install -l to list the latest stable Ruby versions before installing
    • Use the ruby-build plugin to install Ruby versions and rbenv uninstall to remove them
    • Add bash plugins to customize how rbenv works, as described in the README
    • Set up shell completions for bash or zsh as described in the README

Downloads

Strengths

  • Switches Ruby versions automatically when you change project directories
  • Installs under your home directory, so you can avoid using sudo for gems
  • Customizable through bash plugins

Trade-offs

  • The README says its simplicity has downsides and points to a comparison of alternatives
  • Debian and Ubuntu packages are out of date, so the README recommends a git install there
  • Installing Ruby versions depends on the separate ruby-build plugin and your build environment

How it compares

ProjectStarsTypeLevelUpdatedBest for
rbenv (this)16.7kDev toolintermediate4 months agoDevelopers who work on several Ruby projects that need different Ruby versions
asdf25.6kDev toolbeginner5 days agoDevelopers who work on several projects that need different language versions
mise35.7kCLIintermediate4 days agoDevelopers who work on several projects that need different Node.js, Python or Rust versions
nvm95.7kDev toolbeginner9 days agoDevelopers who work on several Node.js projects that need different versions
zoxide40.4kDev toolbeginner5 days agoDevelopers who move between many project folders in a terminal
atuin32.2kDev toolbeginner4 days agoDevelopers who work in a terminal and often need to find past commands

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.