Search code examples
rubygitrubygemsbundlerunpack

Using bundler, how do you unpack a gem installed via a git repository?


How can I unpack a gem specified in bundler by a :git => url?

My Gemfile has

gem 'my_gem', :git => 'git@github.com:xxxxx/xxxxx.git'

$ bundle correctly reports the gem as available, and my code works. $ bundle which my_gem even tells me where my gem is stored. However:

$ gem unpack my_gem
ERROR:  Gem 'my_gem' not installed nor fetchable.
$ bundle exec gem unpack my_gem
ERROR:  Gem 'my_gem' not installed nor fetchable.

Is it possible to unpack a gem installed like this?


Solution

  • Why the need to unpack it? You already have the sourcecode. The point of specifying a git repository is that you don't have a bundled gem, but the source to generate it.

    Simply use

    git clone git://github.com/xxxx/yyy.git
    

    and the source will be in the yyy folder of the current directory.