Ruby 1.9, Rubygems, and .gemspec warnings

R

Rob Sanheim

[Note: parts of this message were removed to make it a legal post.]

Hi all
I'm getting a massive amount of gemspec warnings to STDERR in Ruby 1.9.1
whenever 'rubygems/specification' gets required. The error I'm seeing is:

WARNING: #<NoMethodError: undefined method `>' for nil:NilClass>
WARNING: Invalid .gemspec format in
'/Users/rsanheim/.gem/ruby/1.9.1/specifications/rake-0.8.7.gemspec'

This is happening for just about any gem I install under 1.9, so I don't
think its an issue specific to any one gem. I *only* see the warnings if I
require rubygems/specification -- I can use gems and require rubygems
without the issue.

I've included full output of the issue on pastie, because the log is pretty
long, as gems spits out the full gemspec along side the warnings:

http://pastie.org/608299

Note that the log is from Leopard, but I've also seen the issue on Ubuntu
8.10.

Does this look like something I'm installing wrong, or should I file an
issue against rubygems?

Thanks,
Rob
 
R

Ryan Davis


I just repro'd this with:
% multiruby -rubygems -rrubygems/specification -e 0
...
VERSION = 1.9.1-p129
CMD = ~/.multiruby/install/1.9.1-p129/bin/ruby -rubygems -
rrubygems/specification -e 0

WARNING: #<NoMethodError: undefined method `>' for nil:NilClass>
...
RESULT = 0

TOTAL RESULT = 0 failures out of 4

Passed: 1.9.1-p129, 1.8.7-p72, 1.8.7-p160, 1.8.6-p368
Failed:

That's easy enough to poke around at. I'll get eric's eyeballs on it.
 
R

Ryan Davis

I just repro'd this with:


That's easy enough to poke around at. I'll get eric's eyeballs on it.

OK... Just figured it out. Something bad juju with 1.9's gem_prelude
vs rubygems. Easy fix:

% sudo gem uninstall rubygems-update

then this should work:

% multiruby -rubygems -rrubygems/specification -e 'gem "hoe"'
 
R

Rob Sanheim

[Note: parts of this message were removed to make it a legal post.]

OK... Just figured it out. Something bad juju with 1.9's gem_prelude vs
rubygems. Easy fix:

% sudo gem uninstall rubygems-update

then this should work:

% multiruby -rubygems -rrubygems/specification -e 'gem "hoe"'
I don't remember how I installed gems on this box, but it didn't involve the
rubygems update gem. I think rvm grabs gems from source, not sure:

~ $ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]
~ $ gem uninstall rubygems-update
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d rubygems-update`
~ $ gem list |grep rubygems
~ $ ruby -rubygems -rrubygems/specification -e 'gem "hoe"'
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems.rb:827:in
`report_activate_error': Could not find RubyGem hoe (>= 0) (Gem::LoadError)
from
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems.rb:261:in
`activate'
from
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems.rb:68:in
`gem'
from -e:1:in `<main>'

- Rob
 
R

Ryan Davis

On Thu, Sep 10, 2009 at 4:57 PM, Ryan Davis <ryand-
OK... Just figured it out. Something bad juju with 1.9's
gem_prelude vs
rubygems. Easy fix:

% sudo gem uninstall rubygems-update

then this should work:

% multiruby -rubygems -rrubygems/specification -e 'gem "hoe"'
I don't remember how I installed gems on this box, but it didn't
involve the
rubygems update gem. I think rvm grabs gems from source, not sure:

~ $ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]
~ $ gem uninstall rubygems-update
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d rubygems-update`
~ $ gem list |grep rubygems
~ $ ruby -rubygems -rrubygems/specification -e 'gem "hoe"'
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/
rubygems.rb:827:in
`report_activate_error': Could not find RubyGem hoe (>= 0)
(Gem::LoadError)
from
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/
rubygems.rb:261:in
`activate'
from
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/
rubygems.rb:68:in
`gem'
from -e:1:in `<main>'

Why do you have rubygems installed on 1.9.1? I think that's the entire
problem.

rm -r /Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/
rubygem*
 
R

Rob Sanheim

[Note: parts of this message were removed to make it a legal post.]

On Sep 10, 2009, at 14:36 , Rob Sanheim wrote:

wrote:

On Sep 10, 2009, at 13:50 , Ryan Davis wrote:


On Sep 10, 2009, at 13:42 , Rob Sanheim wrote:

I don't think so, I can reproduce this without jeweler in the mix at
all.

bug:


http://rubyforge.org/tracker/index.php?func=detail&aid=27087&group_id=126&atid=575

code:


http://github.com/rsanheim/ruby19_r...f683fe7848980e10ac7bd2291040ec11ea17/Rakefile

failing build against ruby 1.9:


http://runcoderun.com/rsanheim/ruby...83fe7848980e10ac7bd2291040ec11ea17/1/ruby_191


I just repro'd this with:

% multiruby -rubygems -rrubygems/specification -e 0

...
VERSION = 1.9.1-p129
CMD = ~/.multiruby/install/1.9.1-p129/bin/ruby -rubygems
-rrubygems/specification -e 0

WARNING: #<NoMethodError: undefined method `>' for nil:NilClass>
...
RESULT = 0

TOTAL RESULT = 0 failures out of 4

Passed: 1.9.1-p129, 1.8.7-p72, 1.8.7-p160, 1.8.6-p368
Failed:


That's easy enough to poke around at. I'll get eric's eyeballs on it.


OK... Just figured it out. Something bad juju with 1.9's gem_prelude vs
rubygems. Easy fix:

% sudo gem uninstall rubygems-update

then this should work:

% multiruby -rubygems -rrubygems/specification -e 'gem "hoe"'



I don't remember how I installed gems on this box, but it didn't involve
the
rubygems update gem. I think rvm grabs gems from source, not sure:

~ $ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]
~ $ gem uninstall rubygems-update
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d rubygems-update`
~ $ gem list |grep rubygems
~ $ ruby -rubygems -rrubygems/specification -e 'gem "hoe"'

/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems.rb:827:in
`report_activate_error': Could not find RubyGem hoe (>= 0)
(Gem::LoadError)
from

/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems.rb:261:in
`activate'
from

/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems.rb:68:in
`gem'
from -e:1:in `<main>'

Why do you have rubygems installed on 1.9.1? I think that's the entire
problem.

rm -r
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygem*
I have rubygems installed because the first thing I do after installing Ruby
1.9 is to run gem update --system, which updates gems to 1.3.5. I had
forgotten that that just turns around and installs rubygems-update - so I
actually did use rubygems-update.
So, this is a problem for anyone who wants ruby 1.9 plus gems 1.3.5.
Reverting to gems 1.3.1 "fixes" it:
$ rm -r
/Users/rsanheim/.rvm/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygem*
$ gem -v
1.3.1
$ ruby -rubygems -rrubygems/specification -e 'gem "hoe"; require "hoe"; puts
"hi"'
hi
$ gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.5
Updating RubyGems to 1.3.5
Installing RubyGems 1.3.5
RubyGems 1.3.5 installed
$ gem -v
1.3.5
$ ruby -rubygems -rrubygems/specification -e 'gem "hoe"; require "hoe"; puts
"hi"'
WARNING: #<NoMethodError: undefined method `>' for nil:NilClass>
# -*- encoding: utf-8 -*-
# .....
# same error, produces error log of every gemspec installed

Besides, I've seen this on other developer's machines, so its clearly not a
'just on my box' bug.

- Rob
 
R

Ryan Davis

I have rubygems installed because the first thing I do after
installing Ruby
1.9 is to run gem update --system, which updates gems to 1.3.5. I
had
forgotten that that just turns around and installs rubygems-update -
so I
actually did use rubygems-update.

Well, I recommend you don't do that.
Reverting to gems 1.3.1 "fixes" it:

It doesn't "fix" it, it fixes it.
Besides, I've seen this on other developer's machines, so its
clearly not a
'just on my box' bug.

Nobody implied that it was. It will happen on any instance of 1.9
where you install your own rubygems update. So, for now, don't do that.
 
D

Don French

Well, I recommend you don't do that.


It doesn't "fix" it, it fixes it.


Nobody implied that it was. It will happen on any instance of 1.9  
where you install your own rubygems update. So, for now, don't do that.

Am I missing something? how do you update rubygems with 1.9? Is there
a new process?
Thanks
 
A

Andreas Haller

Don said:
Am I missing something? how do you update rubygems with 1.9? Is there
a new process?
Thanks

Don, i think you just don't. Rubygems now is part of/comes bunded with
Ruby 1.9.

However, i was having the same issue runnig on ruby 1.9.2dev (2009-09-15
trunk 24928) [-darwin9.8.0], but only with a library/gem using Jeweler.

Removing Jeweler solved the problem.
 
R

Ron Green

Rob said:
However, i was having the same issue runnig on ruby 1.9.2dev (2009-09-15
trunk 24928) [-darwin9.8.0], but only with a library/gem using Jeweler.

Removing Jeweler solved the problem.


- Rob

Does anybody know how to fix this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top