bundle-exec and binstubs inconsistent #4780
Comments
That is definitely a bug. What is |
I'm using ruby and bundler shipped as Debian packages without any Ruby version manager. rubygem-integrations is a Debian package which:
So it's possible the bug might be in the Debian packaging.
Environment Bundler 1.12.5 Rubygems 2.5.1 Ruby 2.3.1p112 (2016-04-26 revision 0) [x86_64-linux-gnu] Git 2.8.1 Bundler settings path Set for your local app (/home/foo/bar/.bundle/config): "vendor/bundle" bin Set for your local app (/home/foo/bar/.bundle/config): "bin" disable_shared_gems Set for your local app (/home/foo/bar/.bundle/config): "true" orig_path Set via BUNDLE_ORIG_PATH: "/home/foo/.cabal/bin:/home/foo/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" Gemfile source 'https://rubygems.org' gem 'puppet', '~> 3.7.2' gem 'hiera', '~> 1.3.4' gem 'hiera-puppet', '~> 1.0.0' gem 'r10k', '~> 1.1.4' # vim:ft=ruby Gemfile.lock GEM remote: https://rubygems.org/ specs: CFPropertyList (2.2.8) colored (1.2) cri (2.4.1) colored (>= 1.2) facter (2.4.6) CFPropertyList (~> 2.2.6) hiera (1.3.4) json_pure hiera-puppet (1.0.0) hiera (~> 1.0) json_pure (2.0.1) log4r (1.1.10) puppet (3.7.5) facter (> 1.6, < 3) hiera (~> 1.0) json_pure r10k (1.1.4) colored (>= 1.2) cri (~> 2.4.0) json_pure log4r (>= 1.1.10) systemu (~> 2.5.2) systemu (2.5.2) PLATFORMS ruby DEPENDENCIES hiera (~> 1.3.4) hiera-puppet (~> 1.0.0) puppet (~> 3.7.2) r10k (~> 1.1.4) BUNDLED WITH 1.12.5 |
I could not reproduce this with val "$(rbenv init -)" # See https://github.com/rbenv/ruby-build/wiki#openssl-sslv3_method-undeclared-error wget https://gist.githubusercontent.com/mislav/055441129184a1512bb5/raw cat raw | rbenv install --patch 2.2.3 rbenv global 2.2.3 gem install bundler gem env home # /home/foo/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0 rbenv rehash which bundle # /home/foo/.rbenv/shims/bundle cat > Gemfile <<EOF source 'https://rubygems.org' gem 'puppet', '~> 3.7.2' gem 'hiera', '~> 1.3.4' gem 'hiera-puppet', '~> 1.0.0' gem 'r10k', '~> 1.1.4' EOF bundle install --path vendor/bundler --binstubs # Horrible hack for https://tickets.puppetlabs.com/browse/PUP-3796: touch vendor/bundler/ruby/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb ./bin/puppet --version # 3.7.5 bundle exec puppet --version # 3.7.5 gem install puppet # Installing 4.5.2 rbenv rehash puppet --version # 4.5.2 ./bin/puppet --version # 3.7.5 bundle exec puppet --version # 3.7.5 |
I'm going to say that this seems like an issue with how debian packages ruby, then :/ Sorry I can't be more helpful than that! |
I investigated a bit the problem. The difference between the two commands lies in the ordering/initialization of the With ./bin/puppet:
With
Debian ships packaged ruby libraries in /usr/lib/ruby/vendor_ruby. So with Bundler sets
In pratice what happens, is that when the Ruby interpreter initializes itself, it prepends the values from
The |
Bundler adds
|
Why isn't bundler being installed into your gem home? |
@segiddins Yes, that's a solution. As Debian provides a package for it which I expected it to work. Now maybe, your answer will be « Well this is Debian's fault. Bundler should be installed alone in its own directory. » (as it happens when installing Bundler with gem and the issue I'm describing won't happen in this case) In this case I'd be totally happy and tell the Debian packagers about it :) |
Fo reference, I submitted a bug in Debian which has been closed with this fix:
|
The manpage of bundle-exec claims that:
It does not seem to be completely accurate:
where 3.7.5 comes from Bundler (
bundle install --path vendor/bundle --binstubs
) and 4.5.2 comes from the system.Differences in term of environment:
The text was updated successfully, but these errors were encountered: