[Rubygems-developers] Overriding default directories

Neil Wilson neil at brightbox.co.uk
Sun Aug 17 18:08:13 EDT 2008

Using the 'operating_system.rb' I have been unable to find a simple
way of changing the default directories by altering a single setting.

For ubuntu, gems needs to go in /var/lib/gems/1.8 and the binaries in

With every other setting I keep getting the standard /usr/lib showing
up somewhere, either on the gem path or the binary path depending how
things are changed. Essentially there doesn't appear to be one place
with gems gets the path and the binary path from.

The best I've come up with is:

 # Set the default gem installation directories and paths to the Debian
  # defaults by poking the correct values into the ENV hash.
  ENV['GEM_HOME'] = File.join('','var','lib','gems',ConfigMap[:ruby_version])
  # I don't want to see 'default_dir' ever.
  ENV['GEM_PATH'] = user_dir

Is there a better way?

Neil Wilson

More information about the Rubygems-developers mailing list