[Rubygems-developers] gem generate error undefined method empty? for Gem::Platform
luislavena at gmail.com
Tue Dec 2 17:50:21 EST 2008
On Tue, Dec 2, 2008 at 5:16 PM, Eric Hodel <drbrain at segment7.net> wrote:
> On Dec 2, 2008, at 10:22 AM, Jeremy d wrote:
>> Hi guys,
>> I'm involved in helping run a gem mirror for rightscale.com and we are
>> upgrading the indexes to the new 1.2+ format. When using rubygems
>> 1.3.x (tried 0 and 1 and even svn) I get the following fatal error
>> when generating the index. This happens in various places (not the
>> same place in each version).
>> My main question is: do you know what version of gem rubyforge is
>> using to generate their indexes or do you recommend a specific version
>> to do so? Right now using rubygems version 1.2.0 to generate the
>> indexes successfully completes with no errors and I'm leaning toward
>> using that version.
>> After looking at the indexer code and test, it seemed that using .to_s
>> might be what is expected to cover this case, so I'm attaching the
>> diff so you can see what I mean.
>> ** snip example 1**
>> WARNING: Skipping misnamed gem:
>> => zipruby-0.2.9-x86-mswin32 (zipruby-0.2.9-mswin32)
>> ERROR: While executing gem ... (NoMethodError)
>> undefined method `empty?' for #<Gem::Platform:0xeaa379c>
>> ** end snip **
> Your diff fixes the symptom of the problem, but not the cause. Please run:
> ruby -Ilib bin/gem --debug generate_index -V --modern -d /path/to/repository
> with this patch to trunk:
I traced the problem to some gems (win32utils ones) released early
with 0.9.5 version that contained a serialized Gem::Platform in the
YAML instead of a string.
IMHO indexer should not fail but skip the offending gem like it does
under other circumstances.
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
More information about the Rubygems-developers