开发者

Packaging local ruby gems using Bundler?

开发者 https://www.devze.com 2023-03-28 10:11 出处:网络
I have a project that I\'m working on that uses a gem we\'ve created internally.It\'s not hosted on rubygems.org or github.But we do have it in our repository and in a path on our local machine.

I have a project that I'm working on that uses a gem we've created internally. It's not hosted on rubygems.org or github. But we do have it in our repository and in a path on our local machine.

In our Gemfile, we have something similar to this:

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

We're trying to package all our gems so we can use the warbler gem to create a .war file in order to deploy using jRuby.

We'd like to be able to run something like "bundle install" or "bundle install --local" to make sure all the gems are installed. Then have bundler take all the dependencies specified in 开发者_开发技巧our Gemfile put them in vendor/bundle using the "bundle package" command.

But based on this link (http://gembundler.com/man/bundle-package.1.html), it looks like bundler cannot package gems specified using :path or :git as the source.

Has anyone found a way around this?

How do you "bundle package" gems that are local and that are not part of a git repo or available on rubygems.org?

Thanks.


Breaking news!

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.

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


Judging from this pull requerst, it's a feature planned for 1.1.

One of the core developers gave this workaround, though:

cd vendor/git
git clone git://github.com/foo/foo.git

Then, in your Gemfile, gem "foo", :path => "vendor/git/foo".

There's been some work to fix the issue on this branch.

Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消