Unpack .gem ruby ​​without "gem unpack"?

At work, I have to use the old version of rubygem. Upgrading is not possible due to the lazy IT department.

Is there any way to unzip a file .gemwithout gem unpack?

Thank.

+3
source share
1 answer

Gem files are simply uncompressed tar archives. You can unpack them using the command tar:

$ ls
fruity-0.2.0.gem

$ tar xf fruity-0.2.0.gem 
$ ls
data.tar.gz  fruity-0.2.0.gem  metadata.gz

The file data.tar.gzis a gzip compressed tarball containing gem files, you can unzip it with tar:

$ mkdir gem; cd gem
$ tar xzf ../data.tar.gz
$ ls
fruity.gemspec  Gemfile.lock  LICENSE.txt  README.rdoc  VERSION
Gemfile         lib           Rakefile     spec
+4
source

All Articles