Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Gem.find_home
find_home
lib/rubygems/defaults.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/defaults.rb, line 81
def self.find_home
Dir.home.dup
rescue StandardError
if Gem.win_platform?
File.expand_path File.join(ENV["HOMEDRIVE"] || ENV["SystemDrive"], "/")
else
File.expand_path "/"
end
end
Finds the user’s home directory.
See also
.find_files
.find_latest_files
.find_config_file
.find_spec_for_exe
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0