Remove sitedir from LOAD_PATH
This commit is contained in:
parent
6a7eac25e1
commit
8cb056c657
@ -724,7 +724,7 @@ then
|
||||
fi
|
||||
|
||||
# Disable Ruby options we don't need.
|
||||
RUBY_DISABLE_OPTIONS="--disable=rubyopt"
|
||||
RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt"
|
||||
|
||||
if [[ -z "${HOMEBREW_RUBY_WARNINGS}" ]]
|
||||
then
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "pathname"
|
||||
# We trust base Ruby to provide what we need.
|
||||
# Don't look into the user-installed sitedir, which may contain older versions of RubyGems.
|
||||
require "rbconfig"
|
||||
$LOAD_PATH.reject! { |path| path.start_with?(RbConfig::CONFIG["sitedir"]) }
|
||||
|
||||
require "pathname"
|
||||
HOMEBREW_LIBRARY_PATH = Pathname(__dir__).parent.realpath.freeze
|
||||
|
||||
require_relative "../utils/gems"
|
||||
|
||||
@ -44,6 +44,9 @@ module Homebrew
|
||||
end
|
||||
|
||||
def setup_gem_environment!(setup_path: true)
|
||||
require "rubygems"
|
||||
raise "RubyGems too old!" if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.2.0")
|
||||
|
||||
# Match where our bundler gems are.
|
||||
gem_home = "#{HOMEBREW_LIBRARY_PATH}/vendor/bundle/ruby/#{RbConfig::CONFIG["ruby_version"]}"
|
||||
Gem.paths = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user