Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

BUNDLER_GEMFILE in .bundle/config is ignored? #3081

Closed
mgraham opened this issue Jun 25, 2014 · 2 comments
Closed

BUNDLER_GEMFILE in .bundle/config is ignored? #3081

mgraham opened this issue Jun 25, 2014 · 2 comments

Comments

@mgraham
Copy link

mgraham commented Jun 25, 2014

In .bundle/config, I tried to add

BUNDLE_GEMFILE=Gemfile.local

But the config is ignored when running

$ bundle exec bundle

However this works:

$ BUNDLE_GEMFILE=Gemfile.local bundle exec bundle

@indirect
Copy link
Member

Yep. That's a documented limitation of Bundler. The .bundle/config file is actually found relative to the Gemfile, which means that the Gemfile location can't be changed in config.

@binaryphile
Copy link

Perhaps the documentation should reflect this, since it currently indicates this is possible, resulting in undocumented behavior.

I'm referring specifically to http://bundler.io/v1.7/bundle_config.html:

List of available keys

The following is a list of all configuration keys and their purpose.
[...]

  • gemfile (BUNDLE_GEMFILE): The name of the file that bundler should use as the Gemfile. This
    location of this file also sets the root of the project, which is used to resolve relative paths in the
    Gemfile, among other things. By default, bundler will search up from the current working directory until
    it finds a Gemfile.

[...]

You can set them globally either via environment variables or bundle config, whichever is preferable
for your setup. If you use both, environment variables will take preference over global settings.

I'd just suggest denoting the exception for gemfile in that last paragraph there.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants