Bot releases are visible (Hide)
Have shims survive upgrades via Homebrew #1350
Improve init: warn about missing shell and name the shell explicitly in the template #1099
Sort rbenv versions
output semantically #1111
Remove misleading set by $(rbenv-version-origin)
message when system ruby is in use #1203
Output more information in RBENV_DEBUG mode #1307
Improve compatibility with bash set -u
(nounset) mode #1243
Remove fish completion script #1212
Speed up rehash #1334
Disallow path segments and directory traversal in .ruby-version
files #1156
Avoid type: write error: broken pipe
warning https://github.com/rbenv/rbenv/pull/1195
Fix fish shell initialization #1220
Avoid unintentional globbing in bash completion #1253
Strip -<suffix>
when detecting the shell #1311
Supply head -n
flag explicitly #1332
Published by mislav over 5 years ago
Fix rehash
mechanism for versions of bash that complain about clobbering /dev/null
Enforce absolute RBENV_DIR
to avoid having to unset CDPATH
rbenv-version-file
: ensure that the version file is a file
rbenv init -
: fix output to work without args and set -u
rbenv shell
: better error message when shell integration wasn't enabled
Enable freezing rbenv version via rbenv version-name > .ruby-version
in the shell
rbenv-which
: avoid changing PATH unless necessary
rbenv-prefix
: do not silence rbenv-which errors for system version
Published by mislav over 7 years ago
OLD_RBENV_VERSION
to RBENV_*
conventionPublished by mislav almost 8 years ago
Backwards incompatible:
ruby-local-exec
executable.rbenv-version
legacy version filedefault
, global
legacy global version filesFeatures:
rbenv shell -
style of invocation that restores previous versionHousekeeping:
.
with source
for fish shellrbenv <cmd> --help
for sh-*
commandsPublished by mislav almost 9 years ago
rbenv is a robust tool that follows the UNIX methodology to implement per-project selection of Ruby versions and related runtime environment. The rbenv community maintains an ecosystem of plugins, and rbenv has inspired many other forks for managing environments of different programming languages and other software tools.
rbenv works by:
shims/
directory prepended to PATH environment variable;.ruby-version
file in the project's directory that specifies the Ruby version to be activated.The rbenv-installer script automates installation or upgrading rbenv on your system with either Homebrew (if available) or by using git to install to ~/.rbenv
directory.
For manual installation instructions and more details, see Installation chapter of rbenv README.
realpath
C extensionrbenv rehash
when there are many Ruby versions with similar sets of executablesrbenv-which
for "system" versionrbenv-exec
calling out to rbenv-version-name
twiceTo compile the optional C extension that speeds up rbenv across the board:
# substitute with location where you installed rbenv source:
$ cd ~/.rbenv
$ src/configure && make -C src
version-name
and version-origin
enable plugin authors to hook into version selection logic.rbenv versions --skip-aliases --bare
will only list versions that are not aliases (symlinks) for other versions.rbenv version-file <dir>
finds a .ruby-version
file in the target directory or any of its parent directories.rbenv init
now recognizes and supports fish shell syntax. 🐟rbenv --debug <command>
is a shortcut for enabling RBENV_DEBUG.rbenv()
shell function in ksh and dash
source
instead of .
rbenv init
set +h
rbenv()
shell function preserves multiline output of sh-*
commandsrbenv local
now respects .ruby-version
file in parent directories as wellrbenv versions
now emits a warning when no Ruby versions were foundrbenv <command> --help
as alternative to rbenv help <command>
rbenv --version
when rbenv was installed from gitrbenv-help
output under MAWK (Ubuntu)gawk
over awk
if both are availablerbenv-hooks
rbenv rehash
when paths have spaces in themrbenv-exec
fail for invalid Ruby versionreadlink
is not availablerbenv prefix system
.ruby-version
on platforms that don't support process substitution.ruby-version
fileshead -c
CDPATH
IFS
is reset to its original value within hook scriptsPublished by mislav about 11 years ago
rbenv help
command.-e
from the shebang in favor of set -e
at the top ofPublished by mislav about 11 years ago
$PATH
.rbenv rehash
command operate atomically.rbenv init
script to automatically run rbenv rehash
so that shims are recreated whenever a new shell is opened.Published by mislav about 11 years ago
rbenv set-default
to rbenv global
and rbenv set-local
rbenv local
. The set-
commands are deprecated and will begreadlink
on Solaris.ruby-local-exec
command which can be used in shebangs in#!/usr/bin/env ruby
to properly set the project-specificrbenv rehash
when no binaries are present.rbenv-sh-*
commands, which run inside therbenv shell
command for conveniently setting the$RBENV_VERSION
environment variable.~/.rbenv
with the $RBENV_ROOT
environment variable.set -x
when the$RBENV_DEBUG
environment variable is set.~/.rbenv/plugins
as documented/usr/local/etc/rbenv.d
to the list of directories searched$RBENV_DIR
environment variable whichPublished by mislav about 11 years ago
rbenv
command to ensure that RBENV_DIR
is always anruby-local-exec
wrapper would go into an infinite loop whenPublished by mislav about 11 years ago
rbenv root
command which prints the value of$RBENV_ROOT
, or the default root directory if it's unset.rbenv rehash
.readlink
for paths with spaces.rbenv rehash
creates or removes shims only when necessary insteadRBENV_DIR
, when specified, would be incorrectlyset-default
and set-local
commands.--no-rehash
option to rbenv init
for skipping thePublished by mislav about 11 years ago
.ruby-version
files to .rbenv-version
files.ruby-version
file has the same format as .rbenv-version
but isruby-local-exec
and moved its functionality into theruby
shim. See the ruby-local-exec wiki$PATH
.rbenv help
so that usage and documentation is stored as arbenv --version
for printing the current version of rbenv./usr/lib/rbenv/hooks
to the plugin hook search path.rbenv init
by avoiding rbenv reinitialization and byrbenv which
and rbenv prefix
with system Ruby versions.rbenv exec
to avoid prepending the system Ruby location to$PATH
to fix issues running system Ruby commands that invoke otherrbenv rehash
to ensure it exits with a 0 status code underrbenv rehash
to run hash -r
afterwards, when shell+=
operator to support older versions of Bash.rbenv versions
output to include system
, ifrbenv versions
not to display a warning if the currentlyrbenv
shellrbenv shell
to ensure it exits with a non-zero status onrbenv which
to account for path entries with spaces.rbenv init
to accept option arguments in any order.