Skip to content

Plugins

Mislav Marohnić edited this page Oct 1, 2022 · 57 revisions

See Authoring plugins for instructions on how to write new commands for rbenv or hook into its functionality.

A plugin can be installed by dropping it in as a sub-directory of $RBENV_ROOT/plugins, or it can be located elsewhere on the system as long as rbenv-* executables are placed in the $PATH and hooks are installed accordingly somewhere in $RBENV_HOOK_PATH.

Approved plugins

These plugins are endorsed by rbenv maintainers.

  • ruby-build - compile and install Ruby
  • ctags - automatically generate ctags for rbenv Ruby stdlibs
  • vars - safely sets global and per-project environment variables
  • each - execute the same command with each installed Ruby
  • update - update rbenv and installed plugins
  • use - RVM-style use command
  • whatis - resolve abbreviations to full Ruby identifiers (useful for other plugins)
  • aliases - create aliases for Ruby versions

RubyGems-related plugins:

  • default-gems - automatically install specific gems after installing a new Ruby
  • communal-gems - share gems across multiple Ruby installs
  • gemset - basic gemset support
  • gem-src - automatically git clones each installed rubygem's repository

Bundler integration

There is rbenv-bundler which adjusts rbenv's shims and rbenv which command with respect to the current project's bundle. However, its usage is not recommended because of poor performance and being bug-ridden.

If you want to free yourself from having to always write bundle exec <command> in a project, you can generate Bundler's binstubs:

bundle install --binstubs

Now you can run bin/rake instead of bundle exec rake.

If you want to be able to just type rake, you have two options from here:

  1. You can add ./bin to your $PATH. See Understanding binstubs for more info.
  2. You can install the rbenv-binstubs plugin and run rbenv rehash from your project.

Community plugins

In alphabetical order:

  • around-install - run scripts before and after rbenv install (externalised ruby-build hooks)
  • bundle-exec - Runs commands using bundle exec when invoked from a bundler-managed directory
  • bundler-ruby-version - picks a ruby version from Gemfile
  • ccache - Make Ruby build faster, with using the leverage of ccache.
  • chefdk - Use ChefDK as if it where just another rbenv version.
  • clean - gem clean for rbenv
  • env - Adds rbenv env command to show relevant environment variables
  • gem-update - automatically run gem update --system on rbenv install
  • gemdir - Return the gem directory of the currently selected ruby
  • git - rbenv git command to run git in directories of rbenv and all installed plugins
  • install-remote - support for installing rubies using a custom definition defined remotely (like a gist)
  • iterate - Execute a command in multiple, specific rbenv rubies
  • jruby-mode - run jruby in different mode (1.8, 2.0) by adding suffix to version
  • man - easily access man pages for current Ruby version
  • mygemfile - use Mygemfile as bundler gemfile if it exists
  • only - execute the same command for specified rubies
  • path - manage contents of $PATH (likely of interest to plugin writers)
  • plug - easiest rbenv plugin installer
  • plugin - manage rbenv plugins
  • pluger - rbenv plugin manager and booter
  • rails - create rails project with the version.
  • readline - Automatically link rbenv Ruby installs to readline on OS X
  • rvm-download - Download ruby binaries from RVM repository
  • sentience - Make rbenv self-aware - creates a .ruby-version file inside the root of the installation directory
  • set - install a version of ruby, and set it as global in one command
  • sudo - run rbenv-provided rubies and gems from within a sudo session
  • update-rubies - install updated ruby versions (1.9.3-p547 => 1.9.3-p550, 2.1.0 => 2.1.4)
  • usergems - store gems and shims in ~/.rbenv-usergems