seattlerb / zentest

144 stars 72 forks source link

Illformed requirement ["< 2.1, >= 1.8"] #28

Closed xsuchy closed 11 years ago

xsuchy commented 11 years ago

Travis on our project with new ZenTest (4.8.4) fails with:

Invalid gemspec in [/home/travis/.rvm/gems/ruby-1.9.3-p327/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]

This happen both with ruby 1.8 and 1.9.3.

Rolling back to previous version of ZenTest resolve this issue.

Deradon commented 11 years ago

I can confirm this.

$ rspec spec

> Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p374@cmf/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
> /usr/local/rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find ZenTest-4.8.4 in any of the sources (Bundler::GemNotFound)

ZenTest 4.8.4 Gemspec

$ cat /usr/local/rvm/gems/ruby-1.9.3-p374@cmf/specifications/ZenTest-4.8.4.gemspec

Gem::Specification.new do |s|
  s.name = "ZenTest"
  s.version = "4.8.4"

  s.required_rubygems_version = Gem::Requirement.new("< 2.1, >= 1.8") if s.respond_to? :required_rubygems_version=
....

Compared to ZenTest 4.8.3 Gemspec

$ cat /usr/local/rvm/gems/ruby-1.9.3-p374@cmf/specifications/ZenTest-4.8.3.gemspec

Gem::Specification.new do |s|
  s.name = "ZenTest"
  s.version = "4.8.3"

  s.required_rubygems_version = Gem::Requirement.new("~> 1.8") if s.respond_to? :required_rubygems_version=
...
Deradon commented 11 years ago

Ok, did some digging.

The generated Gemspec of 4.8.4 got:

s.required_rubygems_version = Gem::Requirement.new("< 2.1, >= 1.8") if s.respond_to? :required_rubygems_version=

but this should be:

s.required_rubygems_version = Gem::Requirement.new("< 2.1", ">= 1.8") if s.respond_to? :required_rubygems_version=

# OR

s.required_rubygems_version = Gem::Requirement.new(["< 2.1", ">= 1.8"]) if s.respond_to? :required_rubygems_version=

This line is generated by Hoe in https://github.com/seattlerb/zentest/blob/master/Rakefile#L16:

Hoe.spec "ZenTest" do
  # ...
  require_rubygems_version [">= 1.8", "< 2.1"]
end

The feature for multiple requirements in Ho was implemented in this commit: https://github.com/seattlerb/hoe/commit/82cac66b32590b3ea244e02c0e352fdeb785f15e

So, I guess, the output of Hoe is not compatible to Gem::Requirement here. (Gem::VERSION == 1.8.24)

zenspider commented 11 years ago

On Jan 23, 2013, at 03:07 , Patrick Helm notifications@github.com wrote:

So, I guess, the output of Hoe is not compatible to Gem::Requirement here. (Gem::VERSION == 1.8.24)

No, the problem is that rubygems doesn't round-trip gemspecs properly.

See commit rubygems/rubygems@e1300ed46dfa8a16e15a10c0f8de8ad3b9272672.

I totally forgot about this and released this before rubygems released this patch. Not sure what the correct thing to do at this point is. @drbrain?

noahgibbs commented 11 years ago

+1, same problem.

severin commented 11 years ago

+1, same problem...

drbrain commented 11 years ago

@evanphx reports he will have a RubyGems 1.8 release out today or tomorrow with the commit that fixes this problem.

zenspider commented 11 years ago

Looks like tomorrow at the earliest.

febeling commented 11 years ago

One option would be to yank v4.8.4 for the time being, because it uses an unreleased Rubygems feature. ZenTest could be rre-eleased like this as 4.8.5 or whatever once rubygems 2 is out.

As it is now, every user of ZenTest or autotest runs into this, plus a number of devops who are not using it directly but through involved Gemfiles.

severin commented 11 years ago

+1 on this: I don't use ZenTest directly but some dependency brings it into the project as a secondary dependency. So at the moment I have to "litter" my Gemfile with an entry for ZenTest so that I'm able to pin it at an old, working version....

Plus: right now ZeTest is just broken, since it depends on some unreleased feature...

Deradon commented 11 years ago

+1, I had to lock ZenTest at 4.8.3 for several projects, just because some other Gems have the ZenTest dependency.

zenspider commented 11 years ago

Update to rubygems 1.8.25 and this should go away.

If I understand it correctly... you'll have to reinstall zentest because the cached extracted gemspec will still be bad. I think gem pristine ZenTest should do the trick w/o a download.

xsuchy commented 11 years ago

If I need rubygems 1.8.25, then the requirements should be changed to: ["< 2.1, >= 1.8.25"]

bf4 commented 11 years ago

please yank 4.8.4 as it makes automatic dependency management more difficult when we have to specify 4.8.3 until 4.8.5 is released.

zenspider commented 11 years ago

On Jan 27, 2013, at 16:55 , Benjamin Fleischer notifications@github.com wrote:

please yank 4.8.4 as it makes automatic dependency management more difficult when we have to specify 4.8.3 until 4.8.5 is released.

Nope. Upgrade rubygems.

bf4 commented 11 years ago

ok FYI @zenspider, though according to the official page, rubygems 1.8.25 isn't out yet. I have 1.8.24 https://rubygems.org/pages/download (yes, I see it was apparently released two days ago https://rubygems.org/gems/rubygems-update )

evanphx commented 11 years ago

That was an oversight on my part, rubygems.org now shows 1.8.25 as the current version.

--Evan Phoenix // evan@fallingsnow.net

On Sunday, January 27, 2013 at 5:37 PM, Benjamin Fleischer wrote:

ok FYI @zenspider (https://github.com/zenspider), though according to the official page, rubygems 1.8.25 isn't out yet. I have 1.8.24 https://rubygems.org/pages/download (yes, I see it was apparently released two days ago https://rubygems.org/gems/rubygems-update )

— Reply to this email directly or view it on GitHub (https://github.com/seattlerb/zentest/issues/28#issuecomment-12765772).

scotthelm commented 11 years ago

I upgraded rubygems and still recieved the invalid gemspec issue even after gem pristine ZenTest. This put me back at 4.8.2. So I did a gem update ZenTest and it cleared the issue. All's good now.

DouglasAllen commented 11 years ago

It's still there in version 4.9.0. Shall we open this up again?

zenspider commented 11 years ago

@DouglasAllen , no. Please read the ticket again. The problem is not in zentest.

lcdvirgo commented 11 years ago

@DouglasAllen Try 'gem update --system' to update to the latest gem because ZenTest requires RubyGems version ~> 1.8. I just solved mine.

xsuchy commented 11 years ago

@zenspider It is problem in ZenTest. Because it use so new syntax and therefore require so new rubygems. This will effectively block new version on ZenTest in some distributions (I can speak for RHEL at least). #justsaying We can live with older versions.

zenspider commented 11 years ago

Just because you say it is doesn't make it so. I'm not using anything new. I'm not doing anything that hasn't been allowed for years and years. I simply exposed a bug in rubygems. We fixed it. That is how software works.

And quite frankly, I don't care about RHEL or any other linux-based software-crippling dogma. Uninstall the mangled version of rubygems that the package manager installed and install rubygems directly like the rest of the world does. Then upgrades are free and easy. There is a reason why rvm is so popular and gaining freedom from linux is a huge part of that.

bakks commented 11 years ago

+1 for removing this syntax.

@zenspider you are correct that this is not ZenTest's fault. However, in practical terms, if this is a 10 minute problem for 1,000 people, then you've just wasted 166 man-hours. Also, MANY people are restricted on version by their distro, enterprise environment, etc.

Anyway, this fixed the problem for me

sudo gem update --system; sudo gem pristine ZenTest
zenspider commented 11 years ago

No, if this were a 10 minute problem for 1000 people (and it isn't, as you illustrated so eloquently), then I just exposed a bug that wasted a theoretical 166 man hours. I didn't waste it directly. I found a bug in rubygems, I fixed it, and got that fix released.

Keep your hyperbole and your finger pointing to yourself. The sky isn't falling. Get over yourself.

JESii commented 11 years ago

+1 for @scotthelm's recent comment - that worked for me.

ghost commented 11 years ago

I had the same vexing and circular-path-leading problem.

The minimum fix for me was: rm /usr/local/rvm/gems/ruby-1.9.2-p290/specifications/ZenTest-4.9.0.gemspec gem update --system gem --version # should show at least 1.8.25 gem uninstall ZenTest gem install ZenTest

fabianoalmeida commented 11 years ago

I did the same that @deeptext did and I'm seeing this warning message yet.

fabianoalmeida commented 11 years ago

Ok, I solved my problem. Steps:

gem uninstall ZenTest
gem update --system # Updating Rubygems to version 2.0.0
gem install ZenTest # Installing 4.9.0 version

I hope this help!

kanerogers commented 11 years ago

Thanks @fabianoalmeida! That was super helpful. :+1:

fabianoalmeida commented 11 years ago

@kanerogers welcome! :wink:

byroot commented 11 years ago

Also I'm wondering: why a [">= 1.8", "< 2.1"] requirement ? What is your problem with 2.1 ? It do not even exist yet ?

dannguyen commented 11 years ago

A month later: Thanks again @fabianoalmeida, just came across this problem now, as well as your solution

shamshul2007 commented 11 years ago

I am getting the correct output but at the beginning of execution i am getting "Invalid gemspec in [/var/lib/gems/1.8/specifications/ZenTest-4.9.0.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]"

ghost commented 11 years ago

Dear ShamShul,

I had this problem and it was caused by a version mismatch. Have you seen my stackoverflow answer? It's down the page in discussions.

In summary, you must put an earlier version of ZenTest in your Gemfile. You may also need to uninstall the newer version of the gem.

Oz


From: shamshul2007 [mailto:notifications@github.com] Sent: Sunday, 07 April, 2013 10:42 PM To: seattlerb/zentest Cc: Oz DiGennaro Subject: Re: [zentest] Illformed requirement "< 2.1, >= 1.8"

I am getting the correct output but at the beginning of execution i am getting "Invalid gemspec in

requirement ["< 2.1, >= 1.8"]"

Reply to this email directly or view https://github.com/seattlerb/zentest/issues/28#issuecomment-16032264 it on GitHub. https://github.com/notifications/beacon/W-pfqypxe9dHNR1BdwrUCSuTDqmVkI-em8J Ij-AKYiaUu8zITcelrHzSEKcLxBxl.gif

shamshul2007 commented 11 years ago

Dear Deep, I am not able to find the stackoverflow link please share to me that link.

Regards, Shamshul

ghost commented 11 years ago

This is a start

http://stackoverflow.com/questions/14488605/cant-install-zentest-4-8-4

This is a version conflict problem, with ruby gems at the center. The solution is to install the right gems and to uninstall the wrong ones.

I solved it for me by using an older version of ZenTest. This is a knotty problem and no one solution helps everyone.

Goog Luck,

Oz


From: shamshul2007 [mailto:notifications@github.com] Sent: Monday, 08 April, 2013 10:14 PM To: seattlerb/zentest Cc: Oz DiGennaro Subject: Re: [zentest] Illformed requirement "< 2.1, >= 1.8"

Dear Deep, I am not able to find the stackoverflow link please share to me that link.

Regards, Shamshul

Reply to this email directly or view https://github.com/seattlerb/zentest/issues/28#issuecomment-16093270 it on GitHub. https://github.com/notifications/beacon/W-pfqypxe9dHNR1BdwrUCSuTDqmVkI-em8J Ij-AKYiaUu8zITcelrHzSEKcLxBxl.gif

zenspider commented 11 years ago

In summary, you must put an earlier version of ZenTest in your Gemfile. You may also need to uninstall the newer version of the gem.

No, this is not a solution. @fabianoalmeida nailed it.

shamshul2007 commented 11 years ago

updated the rubygem to 1.8.25 still facing the same issue.

After install ZenTest I tried to uninstall it and I get the following

sham@sham-HP:~/Desktop/simple_cs$ sudo gem uninstall ZenTest Invalid gemspec in [/var/lib/gems/1.8/specifications/ZenTest-4.9.0.gemspec]: Illformed requirement ["< 2.1, >= 1.8"] Invalid gemspec in [/var/lib/gems/1.8/specifications/ZenTest-4.9.0.gemspec]: Illformed requirement ["< 2.1, >= 1.8"] INFO: gem "ZenTest" is not installed

ghost commented 11 years ago

Sorry, I can't give you exact directions.

Are you using the command:

        bundle install

or (more intervention)

        bundle update

In fact, are you using RVM at all?

Oz


From: shamshul2007 [mailto:notifications@github.com] Sent: Tuesday, 09 April, 2013 11:16 PM To: seattlerb/zentest Cc: Oz DiGennaro Subject: Re: [zentest] Illformed requirement "< 2.1, >= 1.8"

updated the rubygem to 1.8.25 still facing the same issue.

Reply to this email directly or view https://github.com/seattlerb/zentest/issues/28#issuecomment-16155947 it on GitHub. https://github.com/notifications/beacon/W-pfqypxe9dHNR1BdwrUCSuTDqmVkI-em8J Ij-AKYiaUu8zITcelrHzSEKcLxBxl.gif

shamshul2007 commented 11 years ago

i am using RVM

shamshul2007 commented 11 years ago

removed the ZenTest completely and the issue is resolved now.Thanks.

meal commented 11 years ago

I had the same problem, just did gem update --system and it's working like a charm

haver commented 11 years ago

I had the same problem. There were two version of ZenTest in ~/.rvm/gems/ruby-1.9.2-p290/specifications/

Here's what I did.

rm ~/.rvm/gems/ruby-1.9.2-p290/specifications/ZenTest-4.9.0.gemspec # manually remove the older version gem update --system gem uninstall ZenTest gem install ZenTest

That fixed the problem.

hiattp commented 11 years ago

@meal 's solution worked for me

rbroemeling commented 11 years ago

We have 'solved' the issue in our environment by removing any dependency on ZenTest and removing the gem itself.

And quite frankly, I don't care about RHEL or any other linux-based software-crippling dogma. Uninstall the mangled version of rubygems that the package manager installed and install rubygems directly like the rest of the world does. Then upgrades are free and easy. There is a reason why rvm is so popular and gaining freedom from linux is a huge part of that.

The attitude so angrily espoused above is poisonous, can be unrealistic in some circumstances, and smacks of zealotry.

zenspider commented 11 years ago

If you want to consider my attitude against linux dogma (aka, linux zealotry) and wanting people to have the freedom to install what they want when they want as zealotry itself, that's your (bent) prerogative... So be it. You're obviously free to use other software.

But: "so angrily espoused"? "poisonous"? I think you may be projecting a little.

As I said before:

"Keep your hyperbole and your finger pointing to yourself. The sky isn't falling. Get over yourself."

joshwand commented 11 years ago

For those using rvm, you can't really do gem update --system, since that will get a 2.0+ version, and rvm requires you to stay on the 1.8 line. Instead, to get the version of rubygems with the fix, do

rvm use YOUR_RUBY_VERSION
rvm rubygems latest

ref: http://stackoverflow.com/questions/15251214/errors-after-gem-update-system

jstreebin commented 11 years ago

This worked for me too

sudo gem update --system; sudo gem pristine ZenTest
hoff2 commented 11 years ago

I had RubyGems 1.8.24 before and was getting this error/warning, and updating to 1.8.25 seems to have fixed it, so you can do "gem update --system 1.8.25" if you can't go to RubyGems 2 for some reason (i feel ya).

spccdt commented 11 years ago

@bakks's solution worked for me, too.