-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Unable to resolve dependencies when using prerelease gem #2938
Comments
Did you try Bundler 1.6? 'gem install bundler --pre' On Mon, Mar 24, 2014 at 3:47 PM, Alex Rothenberg notifications@github.com
|
I think in this case even bundler 1.6.0.RC2 won't help, the problem is Rspec-rails is pointing to 3.0.0.beta2 which is a pre-release version and Rspec on the other hand is pointing to 2.2 which is a non-prerelease version of the gem. So while resolving dependency, it considers this 2.14.1 as the latest version for Rspec and that depends on a Rspec-mock (2.14.1) so it will always fail to resolve (since it can't find 3.0.0.beta2). As for the fix, we can't obviously fetch pre-release versions of the gem if gem in Gemfile is pointing to non-prerelease version. We can either be clear about our resolving policies in documentation or add a flag like (:pre_release => true) which would also take account of pre_release gems versions as well. (for that gem) |
Ah, I see what you're saying. This is deliberate. Rubygems explicitly excludes prereleases unless the version requirement has an alphabetical number in it. So your version requirements, as stated, are actually in conflict. If you want a prerelease, use '>= 2.2a'. On Mon, Mar 24, 2014 at 3:47 PM, Alex Rothenberg notifications@github.com
|
Specifying the version as ">= 2.2a" resolves the Gemfile on 1.6.0.RC2. EDIT: I guess we could add this into our documentation (if its not already there!). |
The error messages change with bundler 1.6.0.rc2 but the problem is still there. I see how prerelease versions are complicated and what I'm about to say could cause problems but what I expected ">=2.2" to mean is a) "anything released 2.2 or greater" and b) "don't get a prerelease version on my account but if some other gem wants one I'm willing as long as its above 2.2". It seems that it only means (a). The problem gets more difficult when the dependency is not in my Gemfile but in a gem I use and I can't change the version to ">=2.2a". If I change the example to
The ammeter.gemspec includes I hoped adding
I actually am the ammeter maintainer so I could release a beta version of ammeter but that seems like a burden to place on app devs that they need to use the betas of both rspec-rails and ammeter and the ammeter and rspec-rails teams need to coordinate beta releases. Just a little more information where this issue is coming from. Also I want to thank you for maintaining this gem and helping me think through this issue :) |
So the thing about prereleases is... they are explicitly only for people to opt in to. So it is by design that it is not possible to simply install rspec and get 3.0.beta when you run |
My understanding now is that if I have an app that depends on both In the case of ammeter I realized I can remove the dependency so avoid the issue so it should all be academic for me. Again thank you for taking the time to help me understand! |
I expected this Gemfile to resolve with the 3.0.0.beta2 versions of all rspec gems
I extracted this from a more complicated example alexrothenberg/ammeter#24 where the
gem 'rspec', '>=2.2'
dependency wasn't in the top level Gemfile but inside another gem.Is this intended behavior or a bug? It was certainly surprising behavior to me but I'm not sure what the logic is around prerelease gems.
The text was updated successfully, but these errors were encountered: