End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem.add_to_load_path
add_to_load_path(*paths)
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems.rb, line 595
def self.add_to_load_path(*paths)
@activated_gem_paths = activated_gem_paths + paths.size
# gem directories must come after -I and ENV['RUBYLIB']
$LOAD_PATH.insert(Gem.load_path_insert_index, *paths)
end
Add a list of paths to the $LOAD_PATH at the proper place.
See also
.activated_gem_paths
.already_loaded?
.binary_mode
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0