Method: Gem.prefix

Defined in:
lib/rubygems.rb

.prefixObject

The directory prefix this RubyGems was installed at. If your prefix is in a standard location (ie, rubygems is installed where you’d expect it to be), then prefix returns nil.



811
812
813
814
815
816
817
818
819
# File 'lib/rubygems.rb', line 811

def self.prefix
  prefix = File.dirname RUBYGEMS_DIR

  if prefix != File.expand_path(RbConfig::CONFIG["sitelibdir"]) &&
     prefix != File.expand_path(RbConfig::CONFIG["libdir"]) &&
     File.basename(RUBYGEMS_DIR) == "lib"
    prefix
  end
end