GEM2DEB(1)
π GEM2DEB(1) π
okay bestie, pull up a chair π«Ά this is gem2deb from section 1 of the manual, and she's about to turn your cute little Ruby gem into a whole Debian package. no cap.
β¨ NAME β¨
gem2deb β converts Rubygems' .gem file into Debian package π
πΈ SYNOPSIS πΈ
gem2deb [OPTIONS] GEMNAME (to download the gem with gem fetch)
gem2deb [OPTIONS] GEMFILE (to use a local .gem file)
so like β either you hand her a GEMNAME and she goes and fetches it with gem fetch, or you hand her an actual local GEMFILE. either way she eats. π
π DESCRIPTION π
so gem2deb takes your gem, turns it into a Debian source package, and then tries to build it. the whole thing is a multi-step situation, like a little ritual. let's break it down:
step one β she converts the gem file into a tar.gz archive, and inside there's a metadata.yml file holding the Gem specification. this is literally the same thing gem2tgz does. iconic behavior.
step two β she unpacks that tar.gz archive and preps a Debian source package, guessing a lot of the defaults from the files inside the archive, or from the Gem specification. this is equivalent to what dh-make-ruby does. now ngl, gem2deb can't figure out every single parameter, for obvious reasons π so pls pls pls go search for the "FIXME" string inside the debian/ directory. she left you notes bestie, read them. the generated Debian source package uses dh_ruby to build the package.
step three β she tries to build the source and binary packages using dpkg-buildpackage. main character energy fr fr.
β¨ OPTIONS β¨
-t,--only-tarballβ stop right after creating thetar.gzarchive. that's it, that's the whole job.-s,--only-source-dirβ stop after preparing the Debian source package directory. do not attempt to build the package.-S,--only-debian-sourceβ only build a Debian source package, no binary packages. source-only era π-d,--no-check-builddepsβ don't check build dependencies when building the package. equivalent to the option with the same name indpkg-buildpackage(1).-pPACKAGE,--packagePACKAGE β specify the package name (default:ruby-*). this gets passed todh-make-ruby. seedh-make-ruby(1).-g,--gitβ import the resulting source package, if there is one, into a git repository under the current directory. the git repo gets named after the source package (so yes, it's influenced by--packageπ).
heads up though: --only-tarball or --only-source-dir will prevent this, because they make gem2deb stop early. girl's gone, she can't import anything.
the import uses gbp import-dsc --pristine-tar (see gbp-import-dsc(1)), so for this to work you need git-buildpackage and pristine-tar installed. no downloads, no import π
--purgeβ after building the package, remove all the files thatgem2debproduced. all of them. source tarballs, Debian package artifacts (.dsc,.deb,.changesetc), and yes β even the source directory itself. lowkey ruthless. this is useful for example when you use it together with--git.--no-wnpp-checkβ stopsdh-make-rubyfrom checking WNPP reports to get the number of a possible ITP (intend to package) bug report. by defaultdh-make-rubydoes check those reports, which requires an Internet access. so if you're offline-ish, this is your girl.-o,--offlineβ preventsdh-make-rubyfrom accessing the internet at all. zero wifi, zero problems β¨-h,--helpβ displaysgem2debusage information. when in doubt, ask her.-v,--versionβ displaysgem2debversion information. know your queen's number π
π¦ HOW THE .GEM -> .TGZ CONVERSION WORKS π¦
okay so a gem named mygem-0.1.0.gem gets converted into a tarball with (approximately) these steps:
mkdir mygem-0.1.0
cd mygem-0.1.0
tar xfm /absolute/path/to/mygem-0.1.0.gem
tar xzfm data.tar.gz
zcat metadata.gz > metadata.yml
rm -f data.tar.gz metadata.gz
cd ..
tar czf mygem-0.1.0.tar.gz mygem-0.1.0
rm -rf mygem-0.1.0
look at her go π so clean. so organized.
π the generated tarball has the following properties π
- Files β it contains all the files the gem contains. every single one. no crumbs left behind π
- Metadata β it contains the gem metadata in a file named
metadata.ymlinside themygem-0.1.0directory.
π SEE ALSO π
π COPYRIGHT AND AUTHORS π
Copyright (c) 2011, Lucas Nussbaum <lucas@debian.org>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
and that's the whole page bestie π slay. this was gem2deb(1), version dated 2026-05-15 β thanks for reading, mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: gem2deb 2.2.9 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms