bills-kitchen icon indicating copy to clipboard operation
bills-kitchen copied to clipboard

[Experimental] put the vagrant bin dir to the front of the PATH

Open tknerr opened this issue 10 years ago • 1 comments

Why?

  • I just ran bundle install in vagrant-berkshelf, which cause vagrant to be bundle-installed from a git source.
  • This caused W:\home\.chefdk\gem\ruby\2.0.0\bin\vagrant.bat to be added / created and this was now in front of the PATH
  • And I got this error then:
C:\Repos\_github\dev-box>vagrant up
W:/tools/chefdk/embedded/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'vagrant' (>= 0) among 308 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=W:/home/.chefdk/gem/ruby/2.0.0;W:/tools/chefdk/embedded/lib/ruby/gems/2.0.0', execute `gem env` for more information
        from W:/tools/chefdk/embedded/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:324:in `to_spec'
        from W:/tools/chefdk/embedded/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:58:in `gem'
        from W:/home/.chefdk/gem/ruby/2.0.0/bin/vagrant:22:in `<main>'

Thoughts:

  • putting the vagrant bin dir in front of the PATH surely helps
  • not sure though how well this plays with vagrant-wrapper?
  • or should we have vagrant-wrapper pre-installed as gem to prevent this?

tknerr avatar Feb 02 '15 16:02 tknerr

Note:

  • having vagrant-wrapper preinstalled as a gem does not help --> same problem after running bundle install near a Gemfile which references vagrant from a git location
  • tried setting BUNDLE_BIN_PATH and BUNDLE_SYSTEM_BINDIR to a directory not on the path but it did not have any effect (in fact no gems ended up there)

tknerr avatar Feb 08 '15 15:02 tknerr