This page is not available in every language. Missing translations are disabled in the language selector.

Quick reference

rbenv Ruby Version Manager Cheatsheet

A quick reference guide for rbenv: managing multiple Ruby installations, shims, version scopes (local, global, shell), and ruby-build.

· Published

rbenv is a lightweight Ruby version manager that lets you switch between different Ruby versions across projects without modifying system binaries.

Version Management

# List all installable Ruby releases
rbenv install -l

# Install specific Ruby version via ruby-build
rbenv install 3.3.0

# List installed Ruby versions
rbenv versions

# Check currently active Ruby version
rbenv version

# Rehash shims after installing new gems with binaries
rbenv rehash

Setting Ruby Versions

Command Scope Description
rbenv local 3.3.0 Local directory Writes .ruby-version file in current folder
rbenv global 3.3.0 System user Sets default fallback in ~/.rbenv/version
rbenv shell 3.3.0 Current terminal Sets RBENV_VERSION environment variable
rbenv local --unset Revert local Removes local directory .ruby-version

Shims & Path Inspection

# Display full path to the executable active in current Ruby
rbenv which gem
rbenv which rake

References

Related topics