Ri bug in new 1.8.2 release

J

jim

Hi

I just installed 1.8.2 on OS X. All looks ok so far, but I
did notice that 'ri String' caused an error. But, for what
it's worth, 'ri Array' and 'ri Hash' work.

./ri String
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in
`concat': cannot convert nil into Array (TypeError)
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in
`merge_in'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_reader.rb:56:in
`get_class'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:in
`each'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:in
`get_class'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_driver.rb:70:in
`report_class_stuff'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_driver.rb:106:in
`get_info_for'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_driver.rb:135:in
`process_args'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in
`each'
from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in
`process_args'
from ./ri:48
 
J

James Edward Gray II

Hi

I just installed 1.8.2 on OS X. All looks ok so far, but I
did notice that 'ri String' caused an error. But, for what
it's worth, 'ri Array' and 'ri Hash' work.

Hmm, just to confuse the issue "ri String" works fine on my OS X box
with Ruby 1.8.2.

James Edward Gray II
 
D

Dave Thomas

Hi

I just installed 1.8.2 on OS X. All looks ok so far, but I
did notice that 'ri String' caused an error. But, for what
it's worth, 'ri Array' and 'ri Hash' work.

Seems to work on my OSX box here. Do you perhaps have an old String
description lying around?
 
J

jim

* Dave Thomas said:
Seems to work on my OSX box here. Do you perhaps have an old String
description lying around?

If I do, it is not in any visible path.
Using the full path to ri still causes the problem.
Maybe the problem occurred when I built the documentation.
How do I completely rebuild the ri docs? I had the
make file build it for me initially.
 
J

jim

How do I completely rebuild the ri docs? I had the
make file build it for me initially.

Ok, this is what I tried:

rdoc --all --ri-system <install-dir>

Maybe that should have been

rdoc --all --ri-system <src-dir>


BTW, is it possible to use the ri and rdoc with 1.8.2
on a 1.8.0 install?
 
J

jim

The reason it is failing is because the comment
section inside the yaml file is empty.

Looking at cdesc-String.yaml:

cat cdesc-String.yaml
...
class_methods:
- !ruby/object:RI::MethodSummary
name: new
comment:
constants: []
...

Whereas looking at cdesc-Array.yaml

cat cdesc-Array.yaml
...
class_methods:
- !ruby/object:RI::MethodSummary
name: "[]"
- !ruby/object:RI::MethodSummary
name: new
comment:
- !ruby/struct:SM::Flow::p
body: "Arrays are ordered, integer-indexed collections of any object.
Array indexing starts at 0, as in C or Java. A negative index is assumed to
be relative to the end of the array---that is, an index of -1 indicates the
last element of the array, -2 is the next to last element in the array, and
so on."
constants: []
...

So, the question is, why didn't the comment section get generated on my machine?
 
D

Dave Thomas

Ok, this is what I tried:

rdoc --all --ri-system <install-dir>

Maybe that should have been

rdoc --all --ri-system <src-dir>

The documentation for built-in classes is in the source for those
classes. The source isn't in the instal dirs, so you'll be missing all
that fine documentation.
BTW, is it possible to use the ri and rdoc with 1.8.2
on a 1.8.0 install?

I don't know, is the simple answer. It should probably work, as I don't
believe it uses anything special.


Cheers


Dave
 
D

Dave Thomas

The reason it is failing is because the comment

So, the question is, why didn't the comment section get generated on
my machine?

Is the timestamp on that file consistent with all the other files in
there? If you delete it, then regenerate the documentation, does it
reappear with an empty section?

I've never seen this before, nor can I reproduce it. I'm not sure where
to look further :(


Dave
 
J

jim

* Dave Thomas said:
Is the timestamp on that file consistent with all the other files in
there? If you delete it, then regenerate the documentation, does it
reappear with an empty section?

The timestamp appeared ok, but after I deleted the String directory
and rebuilt the docs, it now works. If I find time to rebuild from scratch
again, I'll see if I can understand what happened originally.

BTW, if you pass a bogus option into rdoc, it doesn't complain.
For example:

rdoc --all -ri-system .

happily creates documentation in ~/.rdoc.
 
D

Dave Thomas

The timestamp appeared ok, but after I deleted the String directory
and rebuilt the docs, it now works. If I find time to rebuild from
scratch
again, I'll see if I can understand what happened originally.

Sounds like there was simply a spurious file lying around. Glad it's
working OK for you now.

BTW, if you pass a bogus option into rdoc, it doesn't complain.
For example:

rdoc --all -ri-system .

That's because there isn't a spurious option there... it's just the way
this style of option passing works. You told it

--all
-r
-i -system

It's a feature of getoptlong.


Cheers


Dave
 
C

Cameron McBride

OK, I just got this same error. ruby 1.8.2 on linux (somewhat updated
FC1). It borks on 'ri Array', Hash, File and probably more. But
things like 'ri Array#hash' work. I've installed ruby by hand in
/usr, and started installing libs (and their docs in --ri-site). For
example, 'ri NArray' works.

I don't think I'm being a dolt (although if I am, please throw me a
bone) cause I've deleted the docs, and recreated them several times.
Specifically:
% rm -r /usr/share/ri/1.8/system
% cd <src>
% rdoc --all --ri-system

Now the weird part. 'ri Array' works while the 'Generating RI...' is
showing, and then borks with the below error msg after the rdoc is
complete.

/usr/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `concat': cannot
convert nil into Array (TypeError)
from /usr/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:99:in `merge_in'
from /usr/lib/ruby/1.8/rdoc/ri/ri_reader.rb:56:in `get_class'
from /usr/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:in `each'
from /usr/lib/ruby/1.8/rdoc/ri/ri_reader.rb:52:in `get_class'
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:70:in `report_class_stuff'
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:106:in `get_info_for'
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:135:in `process_args'
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in `each'
from /usr/lib/ruby/1.8/rdoc/ri/ri_driver.rb:134:in `process_args'
from /usr/bin/ri:48

And nope, this was a fresh install. No old libraries around (or other
docs to confuse it). Any other ideas? Thanks in advance.

Cameron
 
C

Cameron McBride

To add a little information, I did find a 'File' directory in the
site/ subdir (unrelated to the std file) that was probably installed
via a gem. Renaming this to a new name fixed 'ri File' - so perhaps
there are duplicates.

Is there a way to have this documentation coexist? I really like
having ri available documentation around.

And this doesn't fix everything (at least as far as I can tell),
because Array still doesn't work and I can only find one reference to
it:
% cd /usr/share/ri/
% find . -name 'Array'
/1.8/system/Array

Kick in the head or configuration graciously requested...

Cameron
 
C

Cameron McBride

After coming back with a fresher mind, it does seem to be a simple
duplication. If I rename the /usr/share/ri/1.8/site directory, all
works well. (with the exception of the lost site docs)

Unless I'm mistaken, this pretty much means that ri doesn't seem to
handle name clashes that well. When I install gems, I have it
generating does with --ri-site. Apparently, this is the cause of the
breakage and the root of the error msg I'm getting.

Advice on how to make this stuff happily coexist would be most
welcome. Am I naively doing something silly? I think both ri and
gems are fantastic, and I'm sure there has to be a way.

Thanks.

Cameron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top