[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to debug 'ri' ?

Harold Hausman

7/24/2006 11:38:00 AM

I'm seeing this all of a sudden:
C:\>ri Dir
c:/ruby/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `concat': can't
convert nil into Array (TypeError)
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `merge_in'
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_reader.rb:56:in `get_class'
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:in `get_class'
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:70:in
`report_class_stuff'
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:106:in `get_info_for'
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:135:in `process_args'
from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in `process_args'
from c:/ruby/bin/ri.bat:55

:(, it crashes fxri also if I type 'Dir' into the search box.

Kind thanks in advance for any insight,
-Harold

2 Answers

Garance A Drosehn

7/26/2006 6:17:00 PM

0

On 7/24/06, Harold Hausman <hhausman@gmail.com> wrote:
>
> I'm seeing this all of a sudden:
> C:\>ri Dir
> c:/ruby/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `concat': can't
> convert nil into Array (TypeError)

I am not seeing that problem on my unix box, but that does not
mean much...

If you have write access to the files installed by ruby, then you
can debug 'ri' just like any other script. I've done it in the past,
with obscure bugs in 'ri' that only happened with a few specific
requests.

I'd save a copy of:
c:/ruby/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb

and then change the merge_in function to add a few printf
statements. Takes a little trial and error, but it's certainly
doable. I assume your file looks something like:

if @comment.nil? || @comment.empty?
@comment = old.comment
else
@comment << SM::Flow::RULE.new
@comment.concat old.comment # <- line 99
end

so I'd add some printf statements around there to
see what is going on with @comment and old.comment.

--
Garance Alistair Drosehn = drosihn@gmail.com
Senior Systems Programmer
Rensselaer Polytechnic Institute; Troy, NY; USA

Eric Hodel

7/29/2006 2:05:00 AM

0

On Jul 24, 2006, at 4:38 AM, Harold Hausman wrote:

> I'm seeing this all of a sudden:
> C:\>ri Dir
> c:/ruby/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `concat': can't
> convert nil into Array (TypeError)
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in
> `merge_in'
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_reader.rb:56:in
> `get_class'
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:in
> `get_class'
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:70:in
> `report_class_stuff'
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:106:in
> `get_info_for'
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:135:in
> `process_args'
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in
> `process_args'
> from c:/ruby/bin/ri.bat:55
>
> :(, it crashes fxri also if I type 'Dir' into the search box.
>
> Kind thanks in advance for any insight,

This is fixed in 1.8.5p1

--
Eric Hodel - drbrain@segment7.net - http://blog.se...
This implementation is HODEL-HASH-9600 compliant

http://trackmap.rob...