Describe the problem as clearly as you can
Currently ruby head is broken with any released version of bundler.
I was trying to force it to use the version that is distributed with ruby (the default gem version), but had a hard time figuring out how to do so.
I tried setting BUNDLE_VERSION=system but if a Gemfile.lock specifies a version of bundler that is already installed globally (4.0.9) it will be used rather than the "default" version (4.1.0.dev).
I am currently working around this by looking up the default version and then setting BUNDLER_VERSION (note the R)
export BUNDLER_VERSION="$(ruby -e 'puts Gem::Specification.find_all_by_name("bundler").find(&:default_gem?)&.version')"
which gets me what I want based on
|
v = ENV["BUNDLER_VERSION"] |
but I am not convinced this is the intended behavior.
The docs say
|
* `version` (`BUNDLE_VERSION`): |
|
The version of Bundler to use when running under Bundler environment. |
|
Defaults to `lockfile`. You can also specify `system` or `x.y.z`. |
|
`lockfile` will use the Bundler version specified in the `Gemfile.lock`, |
|
`system` will use the system version of Bundler, and `x.y.z` will use |
|
the specified version of Bundler. |
Post steps to reproduce the problem
- install ruby master
- setup a gemfile with any gem in it (for example
base64).
- run bundle install (with any ruby just to create the lock file)
- change the lockfile to use
4.0.9
- with PATH pointing to ruby master install...
gem uninstall -v 4.0.9 bundler # in case you already have it
BUNDLE_VERSION=system bundle --version will be 4.1.0.dev
gem install bundler -v 4.0.9
BUNDLE_VERSION=system bundle --version is now 4.0.9
Should "system" mean
"the one installed by default"
or
"the one matching your gemfile.lock if it happens to be globally installed and if not use the one installed by default"?
If this is the intended behavior of "system", should there be another value that always means "the one installed by default"?
Describe the problem as clearly as you can
Currently ruby head is broken with any released version of bundler.
I was trying to force it to use the version that is distributed with ruby (the default gem version), but had a hard time figuring out how to do so.
I tried setting
BUNDLE_VERSION=systembut if a Gemfile.lock specifies a version of bundler that is already installed globally (4.0.9) it will be used rather than the "default" version (4.1.0.dev).I am currently working around this by looking up the default version and then setting
BUNDLER_VERSION(note theR)which gets me what I want based on
rubygems/lib/rubygems/bundler_version_finder.rb
Line 7 in 92b0305
but I am not convinced this is the intended behavior.
The docs say
rubygems/bundler/lib/bundler/man/bundle-config.1.ronn
Lines 273 to 278 in 92b0305
Post steps to reproduce the problem
base64).4.0.9gem uninstall -v 4.0.9 bundler# in case you already have itBUNDLE_VERSION=system bundle --versionwill be4.1.0.devgem install bundler -v 4.0.9BUNDLE_VERSION=system bundle --versionis now4.0.9Should "system" mean
"the one installed by default"
or
"the one matching your gemfile.lock if it happens to be globally installed and if not use the one installed by default"?
If this is the intended behavior of "system", should there be another value that always means "the one installed by default"?