Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Gem.prefix
() -> ::String?
prefix
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems.rb, line 830
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
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.
See also
.post_uninstall
.pre_install
.post_reset
.pre_reset
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0