rubygems – 使用Bundler包装当地的ruby?

我有一个项目,我正在使用我们内部创建的宝石.它不在
rubygems.org或github上托管.但我们确实在我们的存储库和本地机器上的路径中拥有它.

在我们的Gemfile中,我们有类似的东西:

gem "our-custom-gem", :path => "/path-to/our-custom-gem"

我们正在尝试打包所有宝石,以便我们可以使用warbler gem创建.war文件,以便使用jRuby进行部署.

我们希望能够运行“bundle install”或“bundle install –local”之类的东西,以确保安装了所有的gem.然后让bundler使用我们的Gemfile中指定的所有依赖项,使用“bundle package”命令将它们放入vendor / bundle中.

但基于此链接(http://gembundler.com/man/bundle-package.1.html),看起来捆绑包无法使用:path或:git作为源包装指定的gems.

有没有人找到解决这个问题的方法?

你如何“捆绑包”本地的宝石,不是git仓库的一部分或在rubygems.org上可用?

谢谢.

最佳答案 爆炸新闻!

Since Bundler 1.2, the bundle package command can also package :git
and :path dependencies besides .gem files. This needs to be explicitly
enabled via the –all option. Once used, the –all option will be
remembered.

文档:http://gembundler.com/man/bundle-package.1.html

点赞