Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RubyGems 1.3.6 does not ‘~>’ with a prerelease version. #398

Closed
ndfred opened this issue Jul 13, 2012 · 9 comments
Closed

RubyGems 1.3.6 does not ‘~>’ with a prerelease version. #398

ndfred opened this issue Jul 13, 2012 · 9 comments

Comments

@ndfred
Copy link

ndfred commented Jul 13, 2012

I just updated to Mountain Lion, installed Cocoapods 0.8.0 and ran pod install to checkout the dependencies of our project. This includes RestKit 0.10.1, which requires JSONKit 1.5pre. Problem is, JSONKit 1.4 gets installed instead.

The RestKit 0.10.1 Podspec contains the jos.dependency 'JSONKit', '>= 1.5pre' statement to require JSONKit, and JSONKit exists in 1.4 and 1.5pre versions. If I change that statement to jos.dependency 'JSONKit', '1.5pre' it works fine and installs 1.5pre. If I change it to jos.dependency 'JSONKit', '> 1.4' it fails with the following error:

[!] Required version (JSONKit (> 1.4)) not found for `JSONKit'.
Available versions: 1.4, 1.5pre

I suspect there is an issue with the ranking algorithm, and the '1.5pre' version does not look very standard. My Ruby context is as follows:

$ pod --version ; ruby --version ; gem list
0.8.0
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

*** LOCAL GEMS ***

activesupport (3.2.6)
addressable (2.2.8)
bundler (1.1.4)
cocoapods (0.8.0)
colored (1.2)
escape (0.0.4)
faraday (0.8.1)
faraday_middleware (0.8.8)
hashie (1.2.0)
i18n (0.6.0)
json (1.7.3)
multi_json (1.3.6)
multipart-post (1.1.5)
octokit (1.7.0)
open4 (1.3.0)
rake (0.9.2.2)
xcodeproj (0.2.3)
@alloy
Copy link
Member

alloy commented Jul 13, 2012

Which RubyGems version does ML ship with?

@ndfred
Copy link
Author

ndfred commented Jul 13, 2012

Here you go, my setup is vanilla Mountain Lion GM:

$ gem --version
1.3.6

I'm not sure if you want to consider ML bugs yet, but as the release is just a few days away and this is expected to be the final version, I figured you would be interested to know how Cocoapods behaves on that new platform.

@alloy
Copy link
Member

alloy commented Jul 13, 2012

Definitely, but I’ll have to install it first to do some proper debugging. Version 1.3.6 should be good, but in the meantime, could you update RubyGems and see if that fixes it?

sudo gem update --system

@ndfred
Copy link
Author

ndfred commented Jul 13, 2012

Installing RubyGem 1.8.24 fixes the problem, thanks!

Please note that JSONKit is the only package among the 25 pods our project uses that behaved this way. Other packages with a >= constraint but with more traditional version numbers installed the expected version.

My latest setup (which fixes the bug):

$ pod --version ; ruby --version ; gem --version ; gem list
0.8.0
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
1.8.24

*** LOCAL GEMS ***

activesupport (3.2.6)
addressable (2.2.8)
bundler (1.1.4)
cocoapods (0.8.0)
colored (1.2)
escape (0.0.4)
faraday (0.8.1)
faraday_middleware (0.8.8)
hashie (1.2.0)
i18n (0.6.0)
json (1.7.3)
multi_json (1.3.6)
multipart-post (1.1.5)
octokit (1.7.0)
open4 (1.3.0)
rake (0.9.2.2)
rubygems-update (1.8.24)
xcodeproj (0.2.3)

@alloy
Copy link
Member

alloy commented Jul 13, 2012

Damn, it’s a real shame Apple did not upgrade Ruby or RubyGems.

I think the fix for this issue was in RubyGems 1.4.0: Dependency “~>”s now respect lower-bound prerelease versions.

We’ll probably have to back port that to 1.3.6 by monkey-patching :(

@alloy
Copy link
Member

alloy commented Jul 13, 2012

(Btw, I have update the title to reflect the issue.)

@ndfred
Copy link
Author

ndfred commented Jul 13, 2012

So this issue would also impact a vanilla Lion install, right?

@alloy
Copy link
Member

alloy commented Jul 13, 2012

Indeed, so I will have to push out a fix for this ASAP.

@alloy alloy closed this as completed in 9b5788e Jul 14, 2012
@alloy
Copy link
Member

alloy commented Jul 14, 2012

Unfortunately trying to backport the fixes meant vendoring so much RubyGems code, that I decided to just have the user update their version. We now exit immediately with a helpful error message telling the user to update.

jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013
alloy added a commit that referenced this issue Oct 25, 2014
Closes #398.

Unfortunately, OS X >= 10.7 ships with 1.3.6 :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants