rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 1.99k forks source link

Bundler 1.1 sometimes fails to find cross-repository dependencies #1138

Closed amikula closed 13 years ago

amikula commented 13 years ago

My company has an internal gem repository where we push proprietary gems, so we have both a :rubygems source and an internal gem source. My Gemfile looks something like this:

source :rubygems source 'http://gems.example.com'

gem 'sawdust', '~> 0.2.0'

...where 'sawdust' is a proprietary gem. 'sawdust' depends on another proprietary gem known as 'mogwai', which in turn depends on two public gems available on rubygems.org, 'curb' and 'json'.

I've stepped through the code and found that the following is happening:

  1. Bundler searches for 'sawdust' on rubygems.org, finds nothing, and adds nothing to the gem index.
  2. Bundler searches for 'sawdust' on the internal repository, finds it, and sees that there is a dependency on 'mogwai'.
  3. Bundler searches for 'mogwai' on the internal repository, finds it, and sees that it depends on 'curb' and 'json'.
  4. Bundler searches for 'curb' on the internal repository and fails.
  5. Bundler reports "Could not find gem 'curb (~> 0.5.4)', required by 'sawdust (~> 0.2.0)', in any of the sources" without ever looking for it on the rubygems.org repository.

As a workaround, I'm able to add 'curb' and 'json' to the Gemfile, which causes them to get indexed from the rubygems.org repository, and the dependency is then correctly installed.

indirect commented 13 years ago

Ouch. Yeah, our tests around private/secondary gem repositories are somewhat weak. Thanks for reporting this, and we'll try to get it fixed!

jyn commented 13 years ago

We had this issue on Heroku cedar-stack. We got around this problem using bundler package (which pushes the gems into vendor/cache).

mscottford commented 13 years ago

I think I'm encountering a similar issue with the cedar stack on heroku, but in my case it involves one of the gems coming from a git repository.

indirect commented 13 years ago

You should be able to work around it by adding the gems to your cache with bubdle cache for now.

On Jul 7, 2011, at 3:18 PM, mscottford reply@reply.github.com wrote:

I think I'm encountering a similar issue with the cedar stack on heroku, but in my case it involves one of the gems coming from a git repository.

Reply to this email directly or view it on GitHub: https://github.com/carlhuda/bundler/issues/1138#issuecomment-1526801

hone commented 13 years ago

This is fixed in master and will go out in 1.1.pre.6. Please try it and reopen the issue if it doesn't fix it for you.