RubyGems file formatEdit

A .gem package is a .tar archive containing:

  • a .tar.gz archive of contents; and
  • a .gz file containing metadata (in YAML format)
  • a .gz file containing checksums (also in YAML format)

To break out the outer archive:

$ tar xvf somegem-0.0.1.gem
x metadata.gz
x data.tar.gz
x checksums.yaml.gz

To inspect or break out the metadata:

$ zless metadata.gz
$ gunzip metadata.gz

To inspect or break out the checksums:

$ zless checksums.yaml.gz
$ gunzip checksums.yaml.gz

To extract the contents:

$ tar xzvf data.tar.gz