Skip to content

Gracefully handling missing git sources for gem dependencies #324

Closed
jeremy opened this Issue May 12, 2010 · 7 comments

7 participants

@jeremy
jeremy commented May 12, 2010

Add a git repos for a gem. That gem may have deps also in git repos.

You "discover" that fact by bundling and getting an error saying there's no such gem, when the real issue is that you didn't realize there was a dep and add the git source to your Gemfile.

Then, that dep has a dep, and repeat. Try bundling DM master for example.

If the resolver can't find a dep for a gem from git source, the error message could give a helpful prod, at least: "this dependency is not in any of the sources, but it may be in another git repository..."

@indirect
Bundler member

I'll look at it when I get a chance. Exact repro steps would help move this up my queue.

@carllerche

Reproduction: Try to get dm-rails running from the git repo :P

@hedgehog

I have run into this issue too. Good news I have a patch that fixes this.... will be sending a pull request shortly

This is as bad the OP says.
The message (as at tag 1.1.pre.1) can actually be misleading:

$ cat <<-EOT >Gemfile
source :rubygems  
gem "chef",:git => "git://github.com/cookbooks/chef.git",:tag => 'qa-latest'
EOT


$ bundle
Fetching git://github.com/cookbooks/chef.git
remote: Counting objects: 914, done.
remote: Compressing objects: 100% (328/328), done.
remote: Total 914 (delta 513), reused 910 (delta 513)
Receiving objects: 100% (914/914), 151.92 KiB | 134 KiB/s, done.
Resolving deltas: 100% (513/513), done.
Fetching source index for http://rubygems.org/
Could not find gem 'chef (>= 0, runtime)' in git://github.com/cookbooks/chef.git (at qa-latest).
Source does not contain any versions of 'chef (>= 0, runtime)'

From my fork:
$ bundle
Fetching git://github.com/cookbooks/chef.git
remote: Counting objects: 914, done.
remote: Compressing objects: 100% (328/328), done.
remote: Total 914 (delta 513), reused 910 (delta 513)
Receiving objects: 100% (914/914), 151.92 KiB | 150 KiB/s, done.
Resolving deltas: 100% (513/513), done.
Fetching source index for http://rubygems.org/
Could not find gem 'runit', required by 'chef', in any of the sources

@hedgehog

Can you confirm this fixes your issue?

#1044

@rohit
rohit commented Nov 9, 2012

This wasn't fixed and I don't think the OP was asking for it to be fixed.

Just that the message from bundler can be misleading although I don't see it that way. The gemspec of dm-rails is specifying 'dm-active_model', '~> 1.3.0.beta' and since it's not in any of the sources (rubygems specifically) you as a developer should know that it's probably not pushed to RubyGems and might be available via some git source too.

You anyway will need to find the tag/ref etc of that specific version. IMHO the error message is sufficient. But if this is desired I guess it should be easy if a git gems dependency can't be satisfied to output an additional message asking to check for other git sources? :)

@rkh
rkh commented Dec 13, 2012

This issue either needs to be widened, or 2154 is not a duplicate or I'm misunderstanding things.

@xaviershay

Please reopen on https://github.com/bundler/bundler-features/issues if this is still desired.

@xaviershay xaviershay closed this Aug 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.