diff options
author | The Bundler Bot <bot@bundler.io> | 2017-10-04 18:29:39 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-10-04 18:29:39 +0000 |
commit | 116de5981d160b428b3ee653582d9225c0c68b51 (patch) | |
tree | fba7af854c1c0da3bd39d30265415851d84d9133 | |
parent | ef569f46b08fc67c6993b6153c4abd7e01c9af3e (diff) | |
parent | f0ff8fc7b6b7ff14166e416359cbd4a3bf9105c2 (diff) | |
download | bundler-116de5981d160b428b3ee653582d9225c0c68b51.tar.gz |
Auto merge of #6073 - bundler:colby/gem-env-dir, r=indirect
Fix uninitialised constant Gem::ConfigFile::SYSTEM_CONFIG_PATH
### What was the end-user problem that led to this PR?
`bundle env` uses the constant `Gem::ConfigFile::SYSTEM_CONFIG_PATH` which is not defined in early versions of RubyGems.
See: https://travis-ci.org/bundler/bundler/builds/276981165
### What is your fix for the problem, implemented in this PR?
While `SYSTEM_CONFIG_PATH` is not defined for earlier versions of RubyGems, a constant called `Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE` does appear to be both in current and early versions of RubyGems which contains the path (plus the ruby config file) we want.
### Why did you choose this fix out of the possible options?
This fix is compatible with all the tested versions of RubyGems in CI and is not overly complex.
-rw-r--r-- | lib/bundler/env.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb index 437dafc65f..58fe20dbe7 100644 --- a/lib/bundler/env.rb +++ b/lib/bundler/env.rb @@ -104,7 +104,7 @@ module Bundler out << [" Platforms", Gem.platforms.join(", ")] out << ["Ruby", ruby_version] out << [" Full Path", Gem.ruby] - out << [" Config Dir", Gem::ConfigFile::SYSTEM_CONFIG_PATH] + out << [" Config Dir", Pathname.new(Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE).dirname] out << ["RubyGems", Gem::VERSION] out << [" Gem Home", ENV.fetch("GEM_HOME") { Gem.dir }] out << [" Gem Path", ENV.fetch("GEM_PATH") { Gem.path.join(File::PATH_SEPARATOR) }] |