Skip to content
This repository

Add excellent gem / gemset management to your rbenv!

branch: master

Remove jruby-specific fix in rbenv hook for finding standard gem inst…

…all path (this was actually fixed by the earlier recursion fix, and should have been removed then). Thanks to @neovatar for starting me down this path (neovatar@ef779f4)!

Also bump version to 0.5.*6*! (0.5.5 should have been the last commit)
latest commit 20365e3107
Jeffrey 'jf' Lim authored
Octocat-spinner-32 bin Refactor as an rbenv plugin bundle September 23, 2011
Octocat-spinner-32 etc Remove jruby-specific fix in rbenv hook for finding standard gem inst… March 22, 2014
Octocat-spinner-32 libexec Remove jruby-specific fix in rbenv hook for finding standard gem inst… March 22, 2014
Octocat-spinner-32 README.mkd Remove jruby-specific fix in rbenv hook for finding standard gem inst… March 22, 2014
README.mkd

Do all that you need to more easily with rbenv-gemset!

rbenv-gemset plugs in to the goodness of rbenv, and brings you gem management that is simple, easy to understand, set up (just one file with the simplest format ever!), and then use, to do pretty much everything that you really need to do with gemsets.

rbenv-gemset is an extension for the rbenv ruby version manager that allows you to use "gemsets", sandboxed collections of gems. This lets you have multiple collections of gems installed in different sandboxes, and specify (on a per-application basis) which sets of gems should be used.

New with v0.4.0! Project gemsets: install gems into a sub-folder in your project directory for easy removal later / customization / testing!

Table of Contents

Installation

GitHub

Download and extract the latest release (v0.5.6 now!) or clone rbenv-gemset to your $HOME/.rbenv/plugins directory:

$ mkdir ~/.rbenv/plugins
$ cd ~/.rbenv/plugins
$ git clone git://github.com/jf/rbenv-gemset.git

Homebrew

If you want to use Homebrew (Mac OS X):

$ brew update
$ brew install rbenv-gemset

Usage

In your application directory, create a file named .rbenv-gemsets, with the names of the gemsets that you want to use on separate lines, or separated by whitespace. The first gemset in the list will be the primary gemset, where new gems will be installed.

$ echo -e "my-gemset\nanother-gemset" > .rbenv-gemsets

Now all commands involving gems will use the gemsets that you've specified.

To have gems install into a sub-folder in your project directory for easy removal later (rm -rf project!) / editing / testing, you can use a project gemset. A project gemset has a '.' ("dot") as the first character:

$ echo '.gems' > .rbenv-gemsets

Your gems will then get installed in project/.gems. If you don't want to use a "dot directory" to house your gems but still want to use a project gemset, then do something like this instead:

$ echo './gems' > .rbenv-gemsets

Your gems will then get installed in project/gems.

The gemset plugin will cause rbenv to search for the .rbenv-gemsets file in the current directory, as well as in all ancestor directories, so as long as there is an .rbenv-gemsets file at or above the current directory.

Special environment variable tips and tricks

RBENV_GEMSETS: You can use this environment variable when you want to work with a certain gemset (or gemset list!). For a quick install into a certain gemset, for example:

$ RBENV_GEMSETS="global" gem install thin

RBENV_GEMSET_FILE: You have to know what you're doing, but you can set RBENV_GEMSET_FILE to the absolute path of a gemset file if you want to use another gemset file that isn't in any of your ancestor directories. Note that you have to be using the same version of ruby for this to work as expected!

$ RBENV_GEMSET_FILE="$HOME/hplabs/project1/.rbenv-gemsets" rails new newproject

How to Report Issues

See http://www.catb.org/~esr/faqs/smart-questions.html#intro.

History

Jamis Buck started the project in 2011, and Joe Fiorini took over as maintainer in May 2012. Jeffrey 'jf' Lim is now the current maintainer, and took over in July 2013.

License

This code is placed in the public domain by the author, Jamis Buck. Use it as you wish. Please prefer good over evil.

Something went wrong with that request. Please try again.