-
Notifications
You must be signed in to change notification settings - Fork 169
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
'rake gemspec:validate' always fails #81
Comments
ValidateGemspec is used to validate an on-disk gemspec is valid. If you haven't created it yet, it doesn't have anything to validate, and thus fails. I've fixed the task to give an error message about it missing if it doesn't exist in 6410b48 |
I'm seeing this error now as well. The gemspec exists, as I've just run rake gemspec:generate. Something is passing nil as the version number when it should be passing the string from the .gemspec |
I've added a |
I'm seeing this too and can confirm that this problem is still present. |
This is happening to me with Jeweler 1.4.0 . Here's what I'm doing: |
This is happening to me too every time I run rake gemspec:validate. |
I too faced this problem - it happens when you rely on VERSION.yml. I deleted that file gem.version = "1.0.1" Generated once again and BOOM, the gemspec validated just fine technicalpickles, to recreate this issue make sure you haven NOT specified the version in Rakefile then do the following:
Hopefully you will be able to figure it out. For now I'm perfectly happy setting the version by hand |
@activestylus: your solutions works. |
biting me too |
Same problem here. Adding version in Rakefile passes validation, but release doesn't work. This issue is closed. Maybe that's why nothing has happened in 7 months? |
For anyone still having this problem, could you point me at the repo using it? I was having difficulties reproducing it, so it was a bit tricky to fix. Also, you could try updating to 1.5.1 to see if that helps. |
Out of frustration, and a desire to learn the underlying plumbing, I switched to using a gem spec directly. However, I can point you at the last commit in which I was using jeweler: https://github.com/ammar/regexp_parser/tree/e365450e10df2975685375b330bb4201b523818e Please note that I had started work on this project before considering jeweler, and thus had my own Rakefile. In addition to the missing version, I now know, after working with gem spec directly, that I was also missing rubyforge_project. I really like the auto-commits and tagging, and plan on revisiting jeweler very soon for the same project. Thanks. |
FWIW i have noticed problems with the '0.0.0' version, or at least with "prerelease" gems (e.g. "0.0.0.snapshot". So I switched to "0.0.1.snapshot" and i think that made it go away. |
1.5.1 does not fix the problem. actually any prerelease suffix will cause this problem |
@technicalpickles Using Jeweler 1.5.1, I created an empty gem and confirmed that this bug's still alive. Feel free to take a look at https://github.com/nickhoffman/jeweler-issue-81 . When I try to validate the gemspec, here's what happens: |
The fix is simple for the user of jeweler, do the gem.version thing mentioned above. In your Rakefile, put this... |
still have this problem with jeweler 1.5.2 and rubygems 1.7.2. Fixed it by adding this to my Rakefile:
|
This disappears the |
Same behaviour as @behrangsa, Jeweler 1.5.2 (also just tested in 1.6.3) here. This started happening relatively recently, it hasn't always been a problem. |
This seems pretty reclusive, and I haven't been able to reproduce. For anyone chiming in (and those that already have), can you include the following infos, please?
@behrangsa it's intentional that setting @rgarner wasn't able to reproduce with your repo :( I tested with ruby 1.9.2 and a few variations of rubygems. There is some good news though. I was able to reproduce on a blank repo. I recently upgraded rubygems all the way up to 1.8.5. I suspect this started coming up between 1.3.7 and 1.8.5. |
I was able to track down where this is happening in the code, but... not so much why :( It's coming up when the gemspec on disk is read into memory and parsed for saneness, ie right here. For whatever reason, when the version is getting set from the gemspec on disk, the version is nil, which is where the Another boggling piece of this is that when you do I checked on @ahamid's suggestion about prereleases, but it seems to be happening regardless of the combination of 0.0.0 and prereleases That all said, I'm kind of considering ditching the way validation happens currently. But first, a history lesson: Back when GitHub did rubygems hosting, one of the biggest pain points was having the gem fail to build due to invalid gemspecs, and there were plenty of interesting ways of accidentally having that happen. One of the earliest goals of jeweler was to make it easier to cope with this, and so it did the same eval that GitHub did, and it was great. Fast forward to today, and well, GitHub doesn't host rubygems anymore, and for rubygems.org, you end up building them yourself. If there's a problem building it, you'll see it pretty quickly :) Given all that, removing this particular validation seems like a good idea. I'll try to get that out next jeweler hacksession I sit down for, and will likely release it as 1.7.x. |
Hi Josh, I think your appraisal of rubygems as the culprit is spot on - now that you mention it I'd just upgraded from 1.3.7 to 1.8.5 myself when this started happening (this was tested with 1.9.2-p0). And please accept my apologies, I'd already checked in the |
I do not agree with rgarner. I am using Rubygems 1.8.11 and I have run into this issue. |
I have the same issue, using: |
I've checked this thread and source code, then I may find something. The main problem is the difference between Another small problem is I think resolving each single problem will fix this issue, but I'll try to fix both of them when I have time. |
Same issue. Jeweler 2.0.1. |
I've seen this today in more than one of my current projects, but just to make sure it wasn't my fault, I tried it from scratch:
A version file has to exist before a .gemspec can be validated:
I try to validate the gemspec:
I run the task with --trace:
I've hunted this down to a failure on assigning the version string in the "virtual" (non-file-based) gemspec that gets generated and passed to the
gemspec_helper.parse
method. It looks like the ValidateGemspec command class just isn't doing the same work of adding versions that the WriteGemspec command class is. (The real gemspec used to build the gem works fine.)I don't understand the Jeweler infrastructure well enough to figure out which version addition code needs to be put in, however, or when; so I'm simply reporting the issue instead of trying to fork and fix it.
The text was updated successfully, but these errors were encountered: