Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Bundler requiring the EXACT version of a dependency when the gemspec has an open-ended constraint. #3285

Closed
george-carlin opened this issue Dec 2, 2014 · 12 comments

Comments

@george-carlin
Copy link

I'm contributing to the Ruby gem koudoku and trying to get it set up with Travis CI - but bundler won't install the required gems. It says there's a compatibility error, but when you look in the gemfiles of the supposedly incompatible gems, you'll see that there shouldn't be any problem.

Here's the error I'm getting on Travis:

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rspec-rails (~> 2.14.0) ruby depends on
      actionpack (>= 3.0) ruby depends on
        rack (~> 1.2.1) ruby
    capybara (>= 0) ruby depends on
      rack (1.0.0)

The offending lines in the gemspec are:

s.add_development_dependency "rspec-rails", "~> 2.14.0"
s.add_development_dependency 'capybara'

I forked the gem and changed the second line so it requires capybara version >= 2.4.0, but I still get the exact same error.

So the gems must just be incompatible, right? Well, you'd think so, but if you look in Capybara's own gemspec you can see it doesn't state it depends on rack version 1.0.0 exactly. The real dependency is on rack version >= 1.0.0.

Why is bundler insisting on 1.0.0 exactly when Capybara itself doesn't require this? Surely this is a bug?

I started a StackOverflow question about this same problem - mudasobwa's answer and my conversation with him in the comments might be helpful.

@segiddins
Copy link
Member

See if @Who828's branch at #3278 fixes the issue?

@george-carlin
Copy link
Author

Maybe, but the issue is only occuring on Travis (and on mudasobwa's machine if you look at our conversation on SO) - I can't replicate it locally! And I have no idea if or how I can get travis to use an edge version of bundler. I'm on OSX and mudasobwa (and Travis) are both using Linux - could this be relevant?

@jorihardman
Copy link

I'm having this exact same issue on OSX:

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    rails (~> 4.1.0) ruby depends on
      activesupport (= 4.1.0) ruby

    paperclip (~> 4.2) ruby depends on
      activesupport (3.0.0)

Snippet from paperclip gemspec:

 s.add_dependency('activesupport', '>= 3.0.0')

@jorihardman
Copy link

In my last comment I was using Ruby 2.1.3 and Bundler 1.7.3. Used RVM to switch to Ruby 2.1.0 and Bundler 1.5.1. Was able to run the same bundle update with no issues.

@indirect
Copy link
Member

indirect commented Dec 3, 2014

@jorihardman can you confirm that upgrading to Bundler 1.7.3 on Ruby 2.1.0 breaks it again? I think this issue is fixed by #3278, which isn't quite done yet.

@jorihardman
Copy link

I updated to the latest bundler, 1.7.7, using ruby 2.1.0 and the same gemfile and update command as before. Same issue resolving dependencies.

@Who828
Copy link
Contributor

Who828 commented Dec 4, 2014

@jorihardman Can you give me output of

bundle env

So I can ensure #3278 fixes the issue before we merge it.

@jorihardman
Copy link

Env is here: https://gist.github.com/jorihardman/d45149b791fdb03bf526

Broken command is bundle update rails_admin

@Who828
Copy link
Contributor

Who828 commented Dec 4, 2014

@jorihardman I can confirm that its fixed with #3278

@jorihardman
Copy link

Awesome. Thank you for looking into it!

@TimMoore TimMoore closed this as completed Dec 9, 2014
@george-carlin
Copy link
Author

Is there any way I can get this PR included in the version of Bundler that's running on my Travis build, or do I have to wait until it's included in the next gem version and Travis themselves upgrade?

@indirect
Copy link
Member

indirect commented Dec 9, 2014

In your Travis pre-build steps, check out the Bundler repo to the commit you want to run, and then run “rake install” inside it.

On Dec 9, 2014, at 4:05 AM, George Millo [email protected] wrote:

Is there any way I can get this PR included in the version of Bundler that's running on Travis, or do I have to wait until it's included in the next gem version and Travis themselves upgrade?


Reply to this email directly or view it on GitHub #3285 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants