Skip to content


dpkg vs rubygem version dependency #269

merged 1 commit into from

2 participants



I would like to verify what's causing the following issue between gem -> deb dependencies. Using FPM to convert all necessary Chef gems into Debian packages. Chef gem itself depends on net-ssh-multi ~> 1.1.0, but net-ssh-multi gem turns as debian package version 1.1.

This causes issue where dpkg >= 1.1.0 dependency can't be satisfied by rubygem-net-ssh-multi-1.1 package.

Is this dpkg issue or is the better way to enforce Rubygems version to always include build number, i.e 1.1 -> 1.1.0 (so far using this fix as temporary workaround).




My fix to get it working is



I don't know what you mean when you say 'net-ssh-multi turns into version 1.1 - here's what I see:

% ruby bin/fpm -s gem -t deb -v 1.1.0 net-ssh-multi
Successfully installed net-ssh-multi-1.1
1 gem installed
Created deb package {"path":"rubygem-net-ssh-multi_1.1.0_all.deb"}

# See what the package version is
% ar p rubygem-net-ssh-multi_1.1.0_all.deb control.tar.gz | tar -zx ./control 
% grep Version ./control
Version: 1.1.0

oooh I see now! The net-ssh-multi has an actual release versioned literally as "1.1" (

I think your patch is probably a decent solution to this.


Want to send a pull request for your patch? Can you also include in the code a comment above your patch that explains the purpose of it - that way it's easier to later :)

@jordansissel jordansissel merged commit 34dbd7f into jordansissel:master

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2012
  1. @radim

    Expand gem version

    radim committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/fpm/package/gem.rb
8 lib/fpm/package/gem.rb
@@ -112,7 +112,13 @@ def load_package_info(gem_path) = [attributes[:gem_package_name_prefix],].join("-")
self.license = (spec.license or "no license listed in #{File.basename(file)}")
- self.version = spec.version.to_s
+ # expand spec's version to match RationalVersioningPolicy to prevent cases
+ # where missing 'build' number prevents correct dependency resolution by target
+ # package manager. Ie. for dpkg 1.1 != 1.1.0
+ m = spec.version.to_s.match /^(\d)?.?(\d+)?.?(\d+)?/
+ self.version = {|m| m ? m : 0}.join('.')
self.vendor =
self.url = spec.homepage
self.category = "Languages/Development/Ruby"
Something went wrong with that request. Please try again.