End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem.prefix
prefix
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems.rb, line 741
def self.prefix
prefix = File.dirname RUBYGEMS_DIR
if prefix != File.expand_path(RbConfig::CONFIG["sitelibdir"]) &&
prefix != File.expand_path(RbConfig::CONFIG["libdir"]) &&
"lib" == File.basename(RUBYGEMS_DIR)
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.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0