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.
Thus, in order to extract the source files from the packaged gem we need to first extract the gem as a tar archive, then extract the data archive inside it and finally the source files can be found in the lib folder under data .
The list command is used to view the gems you have installed locally.
Open up the 'Software Center' app from your launcher and type in `RubyGems` without quotes into the application search box at the top right, and press [enter]. RubyGems then can be installed by just clicking on the button labeled 'Install', thats it.
Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With