rbenv Quick Reference

with tags DokuWiki field-notes ruby rbenv -

This page collectively describes rbenv and ruby-build and quick hints on how to use them together.

Quick Reference

Command Purpose
rbenv install --list Show available rubies to install
~/.rbenv/versions Path rubies intall into
rbenv install 1.9.3-p392 Install ruby version
rm -rf $(rbenv prefix 1.9.3-p392) Remove specified ruby version
rbenv uninstall 1.9.3-p392 Same as above, using ruby-build plugin
$RBENV_VERSION Special env var that overrides the ruby version
.ruby-version Normal way to specify ruby version to be used more details.
rbenv rehash Manually rebuild your shim files. Run this command after you install a new version of Ruby, or install a gem that provides commands.
rbenv shell 1.9.3-p392 Use specific ruby version in this shell instance, overrides any app-specific settings
rbenv shell Reports current shell specific override setting
rbenv shell --unset Removes shell specific override setting
rbenv local 1.9.3-p392 Sets a local application-specific Ruby version by writing the version name to a .ruby-version file in the current directory.
rbenv global 1.9.3-p392 Sets the default version of Ruby to be used in all shells by writing the version name to the ~/.rbenv/version file.
rbenv which irb Displays the full path to the executable that rbenv will invoke when you run the given command (irb).
rbenv whence rackup Lists all Ruby versions with the given command installed (rackup).
gem install ruby-debug19 -- --with-ruby-include=$(rbenv prefix 1.9.3-p392) Install ruby-debug19 gem bound to the specified ruby.

Custom Build Options

You can customize the way ruby builds using special env vars

Links

Older article
Capistrano