diff options
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r-- | lib/bundler.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index df345539c8..610cc484e3 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -34,9 +34,9 @@ require_relative "bundler/build_metadata" # of loaded and required modules. # module Bundler - environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS) + environment_preserver = EnvironmentPreserver.from_env ORIGINAL_ENV = environment_preserver.restore - ENV.replace(environment_preserver.backup) + environment_preserver.replace_with_backup SUDO_MUTEX = Mutex.new autoload :Definition, File.expand_path("bundler/definition", __dir__) @@ -285,7 +285,13 @@ module Bundler def app_config_path if app_config = ENV["BUNDLE_APP_CONFIG"] - Pathname.new(app_config).expand_path(root) + app_config_pathname = Pathname.new(app_config) + + if app_config_pathname.absolute? + app_config_pathname + else + app_config_pathname.expand_path(root) + end else root.join(".bundle") end @@ -451,6 +457,10 @@ EOF Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir end + def preferred_gemfile_name + Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile" + end + def use_system_gems? configured_bundle_path.use_system_gems? end @@ -512,7 +522,8 @@ EOF Your user account isn't allowed to install to the system RubyGems. You can cancel this installation and run: - bundle install --path vendor/bundle + bundle config set --local path 'vendor/bundle' + bundle install to install the gems into ./vendor/bundle/, or you can enter your password and install the bundled gems to RubyGems using sudo. |