RubyGems Guides


As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or $LOAD_PATH. Plugins must be named ‘rubygems_plugin’ (.rb, .so, etc) and placed at the root of your gem’s #require_path. Plugins are discovered via Gem::find_files then loaded. Take care when implementing a plugin as your plugin file may be loaded multiple times if multiple versions of your gem are installed.

The following list of RubyGems plugins is probably not exhaustive. If you know of plugins that we missed, feel free to update this page.

## executable-hooks

Extends rubygems to support executables plugins.

In gem lib dir create rubygems_executable_plugin.rb:

Gem.execute do |original_file|
  warn("Executing: #{original_file}")

## gem-browse

Adds four commands:

## gem-empty

Adds command gem empty to remove all gems from current GEM_HOME.

## gem-ctags

Adds a gem ctags command to invoke the Exuberant Ctags indexer on already-installed gems, and then automatically invokes it on gems as they are installed.

## gem_info

Adds a gem info command with fuzzy matching on name and version. Designed for scripting use.

## gem-init

Adds gem init to create a barebones gem.

## gem-compare

Adds gem compare command that can help you to track upstream changes in the released .gem files by comparing gemspec values, gemspec and Gemfile dependencies and files.

## gem-man

The gem man command lets you view a gem’s man page.

## gem-nice-install

Tries to install system dependencies needed to install your gems with binary extensions using standard gem install command. This currently works only for Fedora, but hopefully will be extended.

## gem-orphan

Adds a gem orphan command that finds and lists gems on which no other gems are depending.

## gem-patch

Adds gem patch command, which enables you to apply patches directly on .gem files. Supports both RubyGems 1.8 and RubyGems 2.0.

## gem-toolbox

Adds six commands:

## gem-wrappers

Create gem wrappers for easy use of gems in cron and other system locations. By default wrappers are installed when a gem is installed.

Adds this commands:

## graph

Adds a gem graph command to output a gem dependency graph in graphviz’s dot format.

## maven_gem

Adds gem maven to install any Maven-published Java library as though it were a gem.

## open_gem

Adds two commands:

## PushSafety

Applies a whitelist to gem push to prevent accidentally pushing private gems to the public RubyGems repository.

## rbenv-rehash

Automatically runs rbenv rehash after installing or uninstalling gems.

## rubygems-desc

Adds gem desc to describe a gem by name.

## rubygems-openpgp

Adds commands and flags to allow OpenPGP signing of gems.

## rubygems-sandbox

Manages command-line gem tools and dependencies with a gem sandbox command. This lets you install things like flay and rdoc outside of the global rubygems repository.

## rubygems_snapshot

Adds gem snapshot to create exports of all your current gems into a single file that you can import later.

## rubygems-tasks

rubygems-tasks provides agnostic and unobtrusive Rake tasks for building, installing and releasing Ruby Gems.