Tired of typing
rvm gemset use, and
rvm gemset create for every project?
auto-gemsets is for you.
Gemfile you encounter will cause auto-gemsets to automatically create and switch to a gemset based on the Gemfile's parent folder. Given a
Gemfile in a directory named
my-project, auto-gemsets will create a
~/.gemsets/my-project directory (if one does not exist), and set all the GEM environment variables appropriate to that gemset. This means that you can enjoy sandboxed gem environments without having to micro-manage your GEM environment.
gem install auto-gemsets gemset init
gemset init command will create a copy of
/usr/local/share/auto-gemsets To use auto-gemsets, you will need to source these files in your
~/.bash_profile on OSX) or
source /usr/local/share/auto-gemsets/auto-gemsets.sh source /usr/local/share/auto-gemsets/default-gems.sh
In addition to these two scripts,
init also creates a
~/.auto-gemsets config file to allow for customization of
auto-gemsets. Currently this file contains only one setting which determines whether or not auto-gemsets reports when it switches gemsets. You can turn reporting on and off by setting the
export AUTO_GEMSETS_REPORTING=on export AUTO_GEMSETS_REPORTING=off
Once you source
source ~/.bashrc) or open a new terminal auto-gemsets will now be active and managing your ruby gems.
auto-gemsets creates a new default gemset, you will need to reinstall
auto-gemsets to use the
gem install auto-gemsets
A NOTE ON UPGRADING: If you've already installed
auto-gemsets you will receive a warning asking you if you wish to overwrite this installation. You may want to do this after updating your
A default gemset will be created for you when you run
gemset init in
If you wish to override this location simply set the
DEFAULT_GEMSET variable somewhere in your
.zshrc depending on your environment:
# auto-gemsets export DEFAULT_GEMSET="/custom/path/to/default_gemset"
auto-gemsets will add this gemset to your
GEM_PATH and add it's bin directory to your
PATH. This gemset will always be active. When another gemset is also active, installed gems will automatically belong to that gemset. When ONLY the
default gemset is active, installed gems will belong to the
Although auto-gemsets focuses on automatic management of your gemsets, there are times when interaction is necessary. For these occaisions, auto-gemsets comes with a command line application named
See the HELP file for
There is also a utility that allows you to isolate your
default gemset when running gem commands named
For more documentation simply type
The defalt-gems command is an auto-gemsets utility to manage gems in the default* gemset from within other gemsets.
default-gems (command) [options]
default-gems install mygem default-gems uninstall mygem default-gems list
default-gems accepts any valid gem command, with any valid arguments and options. It is simply a pass-through to the gem command with the context of the default gemset.