# How to debug 'ri'?

**URL:** <https://www.ruby-forum.com/t/how-to-debug-ri/99603>\
**Category:** Ruby\
**Created:** [July 24, 2006, 1:39pm UTC](https://www.ruby-forum.com/t/how-to-debug-ri/99603 "2006-07-24T13:39:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harold\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Harold\_H](https://www.ruby-forum.com/u/Harold_H)\
**Post date:** [July 24, 2006, 1:39pm UTC](https://www.ruby-forum.com/t/how-to-debug-ri/99603/1 "2006-07-24T13:39:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Harold\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Harold\_H](https://www.ruby-forum.com/u/Harold_H)\
**Post date:** [July 26, 2006, 8:18pm UTC](https://www.ruby-forum.com/t/how-to-debug-ri/99603/2 "2006-07-26T20:18:37Z")

</div>

On 7/24/06, Harold H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.

---

<div class="post-metadata">

**Author:** ![Harold\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Harold\_H](https://www.ruby-forum.com/u/Harold_H)\
**Post date:** [July 29, 2006, 4:07am UTC](https://www.ruby-forum.com/t/how-to-debug-ri/99603/3 "2006-07-29T04:07:42Z")

</div>

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

> ```
> from c:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:70:in
> 
> ```
> 
> Kind thanks in advance for any insight,

This is fixed in 1.8.5p1

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
