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.



824
825
826
827
828
829
830
831
832
# File 'lib/rubygems.rb', line 824

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