Your message dated Wed, 13 Jul 2016 16:57:42 +0000
with message-id <[email protected]>
and subject line Bug#830958: fixed in bundler 1.12.5-3
has caused the Debian Bug report #830958,
regarding ruby-bundler: System-wide ruby packages get predecedence over local 
ones (in some cases)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
830958: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830958
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ruby-bundler
Version: 1.12.5-2
Severity: normal

Dear Maintainer,

When installing gem with Debian-packages Bundler, in some cases (when
using bundle exec) the system-wide version is used before the
Bundler-shipped version:

    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/bundle --binstubs
    puppet --version             # 4.5.2, this comes from Debian
    ./bin/puppet --version       # 3.7.2, this comes from Bundler    
    bundle exec puppet --version # 4.5.2, this comes from Debian

I'd expect `bundle exec puppet` to use the Bundler version instead.

The manpage of bundle-exec [2] claims that:

> If you use the `--binstubs` flag in `bundle install(1)`, Bundler
> will automatically create a directory (which defaults to
> `app_root/bin`) containing all of the executables available from
> gems in the bundle.
>
> After using `--binstubs`, <b>`bin/rspec spec/my_spec.rb` is
> identical to `bundle exec rspec spec/my_spec.rb`</b>.

So I'd expect the two last commands to behave the same.

It turns out [1] that Bundler adds its base directory
(/usr/lib/ruby/vendor_ruby) in RUBYLIB in order to make
RUBYOPT=-rbundler/setup work:

    def set_rubylib
      rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
      rubylib.unshift File.expand_path("../..", __FILE__)
      ENV["RUBYLIB"] = rubylib.uniq.join(File::PATH_SEPARATOR)
    end

The two methods of execution lead to a different $LOAD_PATH. With
./bin/puppet, we have:

    ["/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/r10k-1.1.4/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/systemu-2.5.2/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/log4r-1.1.10/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/hiera-puppet-1.0.0/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/hiera-1.3.4/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/json_pure-2.0.1/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/facter-2.4.6/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/cri-2.4.1/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/colored-1.2/lib", 
"/usr/lib/ruby/vendor_ruby/gems/bundler-1.12.5/lib", 
"/usr/local/lib/site_ruby/2.3.0", "/usr/local/lib/x86_64-linux-gnu/site_ruby", 
"/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/2.3.0", 
"/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.3.0", 
"/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/2.3.0", 
"/usr/lib/x86_64-linux-gnu/ruby/2.3.0"]

In this case, Bundler sets RUBYLIB (in require "bundler/setup") but
the Ruby interpreter is already initialized and it is not prepended to
$LOAD_PATH.

With bundle exec, we have:

    ["/usr/lib/ruby/vendor_ruby", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/r10k-1.1.4/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/systemu-2.5.2/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/log4r-1.1.10/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/hiera-puppet-1.0.0/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/hiera-1.3.4/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/json_pure-2.0.1/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/facter-2.4.6/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/cri-2.4.1/lib", 
"/home/foo/bar/vendor/bundle/ruby/2.3.0/gems/colored-1.2/lib", 
"/usr/lib/ruby/vendor_ruby/gems/bundler-1.12.5/lib", 
"/usr/local/lib/site_ruby/2.3.0", "/usr/local/lib/x86_64-linux-gnu/site_ruby", 
"/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/2.3.0", 
"/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.3.0", "/usr/lib/ruby/2.3.0", 
"/usr/lib/x86_64-linux-gnu/ruby/2.3.0"]

In this case, Bundlet sets RUBYLIB and then exec a new Ruby
interpreter. This Ruby interpreter sees RUBYLIB and prepends it to
$LOAD_PATH.

The problem is that in this case, all the Debian-packaged ruby libs
are used in preference to the Bundler-provided ones which is probably
not what the user intends to do.

Using a local version of bundler fixes the issue:

    gem install --user-install bundler
    ~/.gem/ruby/2.3.0/bin/bundle exec puppet --version # 3.7.5

[1] https://github.com/bundler/bundler/issues/4780

[2] http://bundler.io/v1.12/man/bundle-exec.1.html

-- System Information:
Debian Release: stretch/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (90, 
'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ruby-bundler depends on:
ii  ruby                        1:2.3.0+4
ii  ruby-molinillo              0.5.0-1
ii  ruby-net-http-persistent    2.9.4-1
ii  ruby-thor                   0.19.1-2
ii  ruby2.1 [ruby-interpreter]  2.1.5-2+deb8u2
ii  rubygems-integration        1.10

ruby-bundler recommends no packages.

ruby-bundler suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: bundler
Source-Version: 1.12.5-3

We believe that the bug you reported is fixed in the latest version of
bundler, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Hofstaedtler <[email protected]> (supplier of updated bundler package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Wed, 13 Jul 2016 15:56:33 +0000
Source: bundler
Binary: ruby-bundler bundler
Architecture: source
Version: 1.12.5-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Ruby Extras Maintainers 
<[email protected]>
Changed-By: Christian Hofstaedtler <[email protected]>
Description:
 bundler    - Manage Ruby application dependencies
 ruby-bundler - Manage Ruby application dependencies (runtime)
Closes: 830958
Changes:
 bundler (1.12.5-3) unstable; urgency=medium
 .
   * Do not add system path to RUBYLIB.
     Bundler adds it's own installation path in front of RUBYLIB, but when
     this is the system ruby path, this causes system-wide installed gems
     to be used before bundler-installed gems.
     Thanks to Gabriel Corona for discovering/debugging this. (Closes: #830958)
Checksums-Sha1:
 a879be8a5b1ec2947a77cb496ec7c45b56b2fe64 2140 bundler_1.12.5-3.dsc
 81d03858714e0c9e9c4b493e917a5397f157727c 7224 bundler_1.12.5-3.debian.tar.xz
Checksums-Sha256:
 735673f52977826dbcba004152c54f5d31975f28237f62bb55682e45e74d974c 2140 
bundler_1.12.5-3.dsc
 221410251c80f253ad5b763b4bd58bd7a059a7a25dcc837402e6f661fec149e9 7224 
bundler_1.12.5-3.debian.tar.xz
Files:
 55bccf50700ca4f11c59f7ef800f28bd 2140 ruby optional bundler_1.12.5-3.dsc
 1a88b3e0c23117e94a945fe9453d70be 7224 ruby optional 
bundler_1.12.5-3.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJXhmbdAAoJEFwT1tuTBS4DsfIP/3+ESWWGd+7t9ELh2Om2dLZz
r864E5tqnDWIfyPYpGVDX93aIwAwJgDa2TdNAOewEPJjrN2cn19z7AN12ZovAK3n
D9+/q2xb46GTeXbWtwls4TVLDZJjViP7SvuS62/ucm1/sCs2++/jyWZX5sfLhCHc
fCzzCp1MMhdg7QZJ5dsShiPx2BYudLJJcep3JrKIcWhe6OLkWBinWYB38fLYEtwR
my1gDWP1NybpepWVLk8T24qz0BNgG5pfp2rqpjw4pxjrFwEXO41blPlqJSJFXyZq
f1D72pHRq7bEcpoNZANcxnfbG78Ksz794oyEhvxFburZdl/tx0z0tjK65FxSMeTA
NOlxiscbSTNZsGhKOqycWYjle6KkC3uw0RlTjZxjQ3NYgNEsDxjAlZwBt/FFVBkH
JUwL/H2ieQKpJ1pnpGZ/B5ICk7FemkG4ePG0pw5tOaeRLpKqfEq/HM42g3iN/t5x
hi7j9+ststkTP1W5ihLRlIr82D+mcC4pUszTACLEubc3Sfa53s5ZKjQmLyPXufKC
cKigcg+1rMXatwvTJ08Xnl87PN7LLGJHWqC1Y10pdKRlkkw8FsHbSHEfHubrV/jW
xO0GjsMgNZ5NnHjvYc3c9KU5i21VqYBt7rC3nf/Vof1RLO7kXzbcvo5qHPSsgmMU
akAa4NdcQnftCwMTRDpO
=O8rX
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-ruby-extras-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers

Reply via email to