tpope / vim-bundler

bundler.vim: Lightweight support for Ruby's Bundler
https://www.vim.org/scripts/script.php?script_id=4280
403 stars 29 forks source link

Global Bundler configuration isn't honoured #18

Closed devlinzed closed 11 years ago

devlinzed commented 11 years ago

Bundler configuration can be made global by placing it in ~/.bundle/config. From what I can see, this file isn't honoured by vim-bundler and it fails to find the BUNDLE_PATH within, so it can't locate where the gems are saved. Installing with bundle install --path=whatever adds the line to the local .bundle/config and works as expected.

tpope commented 11 years ago

The path given in the global config is always absolute, correct? And does the project config take precedence over the global config if both are present?

devlinzed commented 11 years ago

It's relative to the directory of the Gemfile. For example, my ~/.bundle/config has BUNDLE_PATH set to .bundle, which emulates bundle install --path=.bundle. As far as I know, project config always takes precedence.

tpope commented 11 years ago

Good, that makes the implementation easier.

devlinzed commented 11 years ago

With your newer version (thanks for pushing that so quickly!) I can sometimes open gems, but it still fails to change the path immediately. After opening a gem, the path is modified and all tags/paths are accessible. Again, using a local .bundle/config appears to solve the issue.

tpope commented 11 years ago

What is the exact byte-for-byte content of your global config?

devlinzed commented 11 years ago

I was actually wrong about how the command line --path option and the global BUNDLE_PATH relate. When using the --path option, you end up with (for example) .bundle/ruby/1.9/gems. When using BUNDLE_PATH, with the same value, you just get .bundle/gems. That inconsistency seems to be the problem here. Sorry for the misinformation - I'd never looked at .bundle in-depth.

Just in case it still helps, the global config is:

---
BUNDLE_PATH: .bundle
BUNDLE_BIN: .bundle/binstubs