[DRE-maint] Bug#710814: rubygems-integration: fails to override bin_path

Christian Hofstaedtler christian at hofstaedtler.name
Sun Jun 2 17:18:00 UTC 2013


Package: rubygems-integration
Version: 1.1
Severity: normal

Hi,

there is a problem with rubygems-integration in which it fails to
properly override the binary path for gems.

This is mostly seen when having bin stubs from previously installed
gems in /usr/local/bin, for example:

% nokogiri
/usr/local/bin/nokogiri:23:in `load': cannot load such file -- /usr/share/rubygems-integration/1.9.1/gems/nokogiri-1.5.9/bin/nokogiri (LoadError)
        from /usr/local/bin/nokogiri:23:in `<main>'

Explicitly calling /usr/bin/nokogiri works fine.

Obviously /usr/share/rubygems-integration/1.9.1/gems/nokogiri-1.5.9/bin/nokogiri
is the totally wrong path for rubygems to search for the binary.

>From looking at rubygems/specification.rb, especially the bin_file
and bin_dir methods, I think this is really a bug or design issue in
rubygems, but given that gem2deb overrides the install layout, I
think rubygems-integration also needs to override Gem::Specification#bin_file
to achieve proper rubygems <-> gem2deb integration.

One could argue that this is a case of "so don't do that then", but our
users are likely to mix the system ruby and system libs with direct
rubygems installs and/or entirely differeny ruby interpreters, and
all of these cause bin stubs to appear in /usr/local/bin.


Relevant code in specification.rb:

  def bin_file name
    File.join bin_dir, name
  end

  def bin_dir
    @bin_dir ||= File.join gem_dir, bindir # TODO: this is unfortunate
  end


This issue was noted first by Paul van Tilburg on IRC.

Thanks,
  C.

-- 
       Christian Hofstaedtler       | design, deploy, scale
http://christian.hofstaedtler.name/ | phone +43 720 699846



More information about the Pkg-ruby-extras-maintainers mailing list