Ubuntu packge doesn't detect libraries properly
Built with pkg:deb, got:
Missing these required gems: rest-client >= 1.4.0 json You're running: ruby 22.214.171.124 at /usr/bin/ruby1.8 rubygems 1.3.7 at /usr/share/foreman/.gem/ruby/1.8, /var/lib/gems/1.8
But the appropriate Ubuntu packages are installed:
$ dpkg -l librestclient-ruby1.8 libjson-ruby1.8 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-=====================-=====================-========================================================== ii libjson-ruby1.8 1.1.9-1 JSON library for Ruby (Ruby 1.8 version) ii librestclient-ruby1.8 1.4.2-1 simple REST client for Ruby@
A workaround is attached - don't check with 'config.gem'. (A more portable answer is to retry with 'require', since the various gems and libs are available that way. The patch below will break anyone who doesn't have the required libs and such..)
#2 Updated by Jochen Schalanda over 10 years ago
- Target version set to 0.2
The report of Disconnect is perfectly valid and the attached patch would fix the issue.
The underlying problem is that Debian (and Ubuntu) packages install Ruby gems in a way that
gem doesn't know about them at all, in contrast to Gentoo Linux for example. If the two offending lines are removed from
rest-client gems won't be installed when running the
gems:unpack rake task.
Another IMHO less attractive solution to the problem would be to add both gems into the
vendor/gems subdirectory and not using system-provided Ruby gems at all. This will lead to bigger packages and code duplication (on the system, file-wise).
In the end there is no perfect solution to this problem, just two possible fixes with some drawbacks each.
From a packager's point of view I'd prefer Disconnect's solution while as a developer I'd prefer the second solution to the problem.