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

Already on GitHub? Sign in to your account

Gem name not parsed correctly #345

asawyer opened this Issue Jun 22, 2012 · 4 comments


None yet
2 participants

asawyer commented Jun 22, 2012

When I tried to generate_index, it died with this stack trace:
NoMethodError: undefined method `nonzero?' for nil:NilClass
_resort! at jruby-complete-!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:286
sort! at org/jruby/RubyArray.java:3252
_resort! at jruby-complete-!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:284
add_spec at jruby-complete-!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:309
add_specs at jruby-complete-!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:323
each at org/jruby/RubyArray.java:1615
add_specs at jruby-complete-!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:322
build_indicies at jruby-complete-!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/indexer.rb:129

It seems that the gem file 1234567890_-1.0.gem ended up with a gem name of 1234567890, and in _resort! it does this:
names = a.name <=> b.name
next names if names.nonzero?

1234567890 <=> 'any string' yields a nil, which doesn't have a nonzero? method.

I think the underlying problem is that the gem name is not being parsed correctly. Not only did it end up as a numeric type, but it lost the trailing underscore.

@evanphx evanphx was assigned Jun 27, 2012


evanphx commented Oct 7, 2012

This was because you injected a gem with a name that wasn't a String (I recall your other bug). This isn't possible now, so the bug is gone.

@evanphx evanphx closed this Oct 7, 2012

asawyer commented Oct 7, 2012

Could you give me a pointer to the commit? I'd like to check when it appears in a JRuby release. Thanks.


evanphx commented Oct 7, 2012

Hm, It appears to be have been in there for a while. What release did you find this issue with and can you replicate it on 1.8.24? Could you show me how to make it happen here?

asawyer commented Oct 10, 2012

I could not reproduce it with JRuby, and I'm not concerned with older releases. It may have been due to old data in our index. I'll reopen the bug if it comes up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment