Bug #669

Ubuntu packge doesn't detect libraries properly

Added by Dis Connect over 10 years ago. Updated over 10 years ago.

Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


Built with pkg:deb, got:

 Missing these required gems:
  rest-client >= 1.4.0

You're running:
  ruby 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
| 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..)

foreman-deb.diff foreman-deb.diff 667 Bytes Dis Connect, 02/15/2011 10:56 AM

Associated revisions

Revision 827f9ee0 (diff)
Added by Jochen Schalanda over 10 years ago

Updated Debian package specification: * made dependencies for foreman-{mysql,pgsql,sqlite3} clearer, refs #638 * added dependencies to librestclient-ruby and libjson-ruby, refs #669 * updated copyright file

Signed-off-by: Jochen Schalanda <>


#1 Updated by Ohad Levy over 10 years ago

  • Category set to Packaging
  • Assignee set to Jochen Schalanda

Joschi, can you please have a look?

#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 config/environment.rb, the json and rest-client gems won't be installed when running the gems:install or 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.

#3 Updated by Ohad Levy over 10 years ago

  • Status changed from New to Closed

Also available in: Atom PDF