4. Environment Variables

You can control the behavior of RubyGems through the following environment variables.

GEMCACHE
  • Name of user defined cache file to use when the site wide cache file is unwritable. (NOTE: we will probably rename this to GEM_CACHE in the next revision to be consistent with the other environment variables).
GEM_HOME
  • Directory containing the master gem repository.
GEM_PATH
  • Path list of directories containing gem repositories to be searched in addition to the GEM_HOME directory. The list should be delimited by the appropriate path separator (e.g. ’:’ on Unix and ’;’ on Windows)
GEM_SKIP
  • List of gems should should not be loaded (normally used for development). The list should be delimited by the appropriate path separator (e.g. ’:’ on Unix and ’;’ on Windows)
HOME
  • Home directory of the user (see below).
HOMEDRIVE
  • Drive containing the users home directory.
HOMEPATH
  • Path to the user’s home directory.
http_proxy or HTTP_PROXY
  • URL of the HTTP protocol proxy to be used to get out of the firewall. The lower case verion will be used first.
make
  • Name of the make program that should be used to build extensions.
USERPROFILE
  • Home directory of the user (used if HOME is not defined).

Finding the user’s home directory can be tricky across different systems. Gems tries the following in order until it finds one that works:

  1. Use HOME if it is defined.
  2. Use USERPROFILE if it is defined.
  3. Use HOMEDRIVE and HOMEPATH together if they are defined.
  4. Use the path you get by having Ruby expand ”~”.
  5. Use “C:/” if you are on a Windows machine.