# How to debug 'ri'?

**URL:** <https://rubytalk.org/t/how-to-debug-ri/29234>\
**Category:** ruby-talk\
**Created:** [24 July 2006 11:38 UTC](https://rubytalk.org/t/how-to-debug-ri/29234 "2006-07-24T11:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harold\_Hausman](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Harold\_Hausman](https://rubytalk.org/u/Harold_Hausman)\
**Post date:** [24 July 2006 11:38 UTC](https://rubytalk.org/t/how-to-debug-ri/29234/1 "2006-07-24T11:38:08Z")

</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)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_descriptions.rb:99:in `merge\_in'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_reader.rb:56:in `get\_class'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_reader.rb:52:in `get\_class'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:70:in  
`report\_class\_stuff'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:106:in `get\_info\_for'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:135:in `process\_args'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:134:in `process\_args'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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:** ![Garance\_A\_Drosehn](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@Garance\_A\_Drosehn](https://rubytalk.org/u/Garance_A_Drosehn)\
**Post date:** [26 July 2006 18:16 UTC](https://rubytalk.org/t/how-to-debug-ri/29234/2 "2006-07-26T18:16:45Z")

</div>

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:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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:

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

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

> **···**
>
> 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)
> 
> --  
> Garance Alistair Drosehn = drosihn@gmail.com  
> Senior Systems Programmer  
> Rensselaer Polytechnic Institute; Troy, NY; USA

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [29 July 2006 02:04 UTC](https://rubytalk.org/t/how-to-debug-ri/29234/3 "2006-07-29T02:04:42Z")

</div>

This is fixed in 1.8.5p1

> **···**
>
> 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)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_descriptions.rb:99:in `merge\_in'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_reader.rb:56:in `get\_class'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_reader.rb:52:in `get\_class'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:70:in  
> > `report\_class\_stuff'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:106:in `get\_info\_for'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:135:in `process\_args'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from c:/ruby/lib/ruby/1.8/rdoc/ri/ri\_driver.rb:134:in `process\_args'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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,
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)  
> This implementation is HODEL-HASH-9600 compliant
> 
> [http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
