You can create a debian environment within ubuntu or your favorite GNU/Linux distro (tested with Fedora) using pbuilder

Ubuntu specific instructions at

We'll use rspec_instafail as an example, substitute the gem you are looking for.

apt-get install git-buildpackage

You can find the code here

gbp-clone --pristine-tar

Follow instructions to run tests at,

and to build a package from git use


To test in a clean debian environment,

sudo pbuilder build ../ruby-rspec-instafail*.dsc