aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/shared_helpers.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-10-29 01:19:36 +0900
committergit <svn-admin@ruby-lang.org>2022-11-10 22:45:31 +0000
commitb5f809c4961bd43b8e77cceebad44e341618998d (patch)
treeab62bbd238f21cada480324ad29ab7344c6988bc /lib/bundler/shared_helpers.rb
parent06e17d7659f42cd59634931e5c8d9dd211c7b2e6 (diff)
downloadruby-b5f809c4961bd43b8e77cceebad44e341618998d.tar.gz
[rubygems/rubygems] Load "bundler/setup" in lib/rubygems.rb
Ruby interpreter loads some special gems at startup: did_you_mean, error_highlight, and syntax_suggest. These gems are loaded before `bundler/setup` is loaded by `RUBYOPT=-rbundler/setup`. So, the versions of the gems are not controllable by Gemfile. This change will `require "bundler/setup"` in rubygems.rb (i.e., before the special gems are loaded). Now `bundle exec` sets an environment variable `BUNDLER_SETUP`, and rubygems requires the variable if defined. See also: https://bugs.ruby-lang.org/issues/19089 https://github.com/rubygems/rubygems/commit/963cb65a2d
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r--lib/bundler/shared_helpers.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 899eb68e0a..0a6afe0e5a 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -284,6 +284,7 @@ module Bundler
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", find_gemfile.to_s
Bundler::SharedHelpers.set_env "BUNDLER_VERSION", Bundler::VERSION
+ Bundler::SharedHelpers.set_env "BUNDLER_SETUP", File.expand_path("setup", __dir__)
end
def set_path