LinuxCommandLibrary

rbenv

Manage multiple Ruby versions per project

TLDR

List installed versions

$ rbenv versions
copy
List available versions
$ rbenv install -l
copy
Install Ruby version
$ rbenv install [3.2.0]
copy
Set global version
$ rbenv global [3.2.0]
copy
Set local version
$ rbenv local [3.2.0]
copy
Show current version
$ rbenv version
copy
Rehash shims
$ rbenv rehash
copy

SYNOPSIS

rbenv command [args...]

DESCRIPTION

rbenv manages multiple Ruby installations. It allows switching between Ruby versions globally, per-project, or per-shell, without modifying system Ruby.
The tool uses shims to intercept Ruby commands and route them to the appropriate version based on context.

PARAMETERS

versions

List installed versions.
version
Show current version.
install version
Install Ruby version.
uninstall version
Remove Ruby version.
global version
Set global default.
local version
Set directory version.
shell version
Set shell version.
rehash
Rebuild shims.
which name
Show executable path.

CAVEATS

Requires ruby-build plugin for install. Shims need rehashing after gem installs. Per-project version via .ruby-version file.

HISTORY

rbenv was created by Sam Stephenson in 2011 as a simpler alternative to RVM. It focuses on doing one thing well - version switching - without modifying shells or managing gemsets.

SEE ALSO

ruby(1), gem(1), rvm(1), asdf(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community