使用捆绑器,如何解压通过 git 存储库安装的 gem?
如何解压由 :git => 在捆绑器中指定的 gem网址?
我的 Gemfile 已
gem 'my_gem', :git => '[email protected]:xxxxx/xxxxx.git'
正确报告 gem 可用,并且我的代码有效。 $bundlewhichmy_gem
甚至告诉我我的 gem 存储在哪里。但是:
$ 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.
这样安装的gem可以解压吗?
How can I unpack a gem specified in bundler by a :git => url?
My Gemfile has
gem 'my_gem', :git => '[email protected]: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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么需要拆包?你已经有了源代码。指定 git 存储库的要点是您没有捆绑的 gem,而是生成它的源。
只需使用
,源代码将位于当前目录的 yyy 文件夹中。
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
and the source will be in the yyy folder of the current directory.
另外,您可以使用以下命令打开 Gemfile 中的任何 gem:
Also, you can open any gem in your Gemfile using:
不完全回答问题,但假设您手头有 gem 文件,它是一堆压缩的 gzip 文件(与通常相反)
metaddata.gz
是 gemspec,而data.tar .gz 是所有文件(lib/my/stuff.rb 等)。
Not exactly answering the question but supposing you had the gem file to hand, it's a bunch of gzip files tarred up (opposite to the usual)
metaddata.gz
is the gemspec, anddata.tar.gz
is all the files (lib/my/stuff.rb
etc).