質問

At work I am forced to use an old rubygem version. Upgrading is not possible due to IT department being lazy.

Is there a way to unpack a .gem file without gem unpack?

Thanks.

役に立ちましたか?

解決

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

$ 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.gz is a gzip compressed tar archive that contains the gem files, you can unpack it using tar:

$ mkdir gem; cd gem
$ tar xzf ../data.tar.gz
$ ls
fruity.gemspec  Gemfile.lock  LICENSE.txt  README.rdoc  VERSION
Gemfile         lib           Rakefile     spec
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top