Using bundler with “--path vendor”, why are gems specified with “:git” not locally vendored?

StackOverflow https://stackoverflow.com/questions/7839752

Question

I'm using bundler and have a Gemfile that looks like this:

source 'http://rubygems.org'
gem 'sinatra', '1.3.1'
gem 'httparty'
# ...etc...
gem 'my_custom_gem', :git => 'git@github.com:me/my_custom_gem.git'

When I run bundle install it fetches the necessary gems, including my custom gem, and installs them in the system gem directory. So far, so good. However, an issue arises when I try to vendor them into a project-local directory. When I run

bundle install --path vendor

It creates the "vendor" directory in my project root and installs all the regular gems there. So I see directories like

vendor/ruby/1.8/gems/sinatra-1.3.1
vendor/ruby/1.8/gems/httparty-0.8.1
...etc...

But it does not vendor the gem specified with a 'git' parameter. I expect to see but do not see anything like

vendor/ruby/1.8/gems/my_custom_gem-1.0.0

It continues to use the system-installed version of this gem. Any explanation for this? Any clean way to get this custom gem vendored as well?

Was it helpful?

Solution

Not supported right now, hopefully coming in Bundler 1.1:

https://github.com/carlhuda/bundler/issues/67

For now you'll have to do:

cd vendor/ruby/1.8/gems/
git clone git://github.com/foo/foo.git

or similar

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top