Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to build a Ruby package using git-buildpackage. I am getting this error near the end of the process:

dh clean --buildsystem=ruby --with ruby
   dh_testdir -O--buildsystem=ruby
   dh_auto_clean -O--buildsystem=ruby
/usr/lib/ruby/vendor_ruby/gem2deb.rb:17: warning: setting Encoding.default_external
  Entering dh_ruby --clean
No XS-Ruby-Versions: field found in source!
dh_auto_clean: dh_ruby --clean returned exit code 1
make: *** [clean] Error 1
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
E: Failed autobuilding of package
I: unmounting dev/pts filesystem
I: unmounting proc filesystem
 -> Cleaning COW directory
  forking: rm -rf /var/cache/pbuilder/build//cow.7268 
gbp:error: Couldn't run 'git-pbuilder': git-pbuilder returned 1

Here is the rules file:

#!/usr/bin/make -f

PACKAGE = $(shell dh_listpackages)
VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 \
                | cut -d- -f1)
TMP := debian/$(PACKAGE)


        dh $@ --buildsystem=ruby --with ruby

        rsync -C --recursive --links --perms --times -v \
          --exclude-from=debian/exclude.rsync --exclude debian $(CURDIR)/ debian/$(PACKAGE)
share|improve this question
up vote 0 down vote accepted

The error is clear. Add the missing XS-Ruby-Versions field to the control file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.