[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ri bug in new 1.8.2 release

Jim Freeze

12/26/2004 11:28:00 PM

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

--
Jim Freeze
Code Red. Code Ruby


12 Answers

James Gray

12/27/2004 3:23:00 AM

0

On Dec 26, 2004, at 5:27 PM, jim@freeze.org wrote:

> 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



Dave Thomas

12/27/2004 5:13:00 AM

0


On Dec 26, 2004, at 5:27 PM, jim@freeze.org wrote:

> 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?



Jim Freeze

12/27/2004 3:10:00 PM

0

* Dave Thomas <Dave@PragProg.com> [2004-12-27 14:12:47 +0900]:
> On Dec 26, 2004, at 5:27 PM, jim@freeze.org wrote:
>
> >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?

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.

--
Jim Freeze
Code Red. Code Ruby


Jim Freeze

12/27/2004 3:29:00 PM

0

* jim@freeze.org <jim@freeze.org> [2004-12-28 00:10:04 +0900]:

> * Dave Thomas <Dave@PragProg.com> [2004-12-27 14:12:47 +0900]:
> > On Dec 26, 2004, at 5:27 PM, jim@freeze.org wrote:
> >
> 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?

--
Jim Freeze
Code Red. Code Ruby


Jim Freeze

12/27/2004 4:56:00 PM

0

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?
--
Jim Freeze
Code Red. Code Ruby


Dave Thomas

12/27/2004 4:57:00 PM

0


On Dec 27, 2004, at 9:28 AM, jim@freeze.org wrote:
> 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



Dave Thomas

12/28/2004 8:35:00 AM

0


On Dec 27, 2004, at 10:56 AM, jim@freeze.org wrote:

> 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



Jim Freeze

12/28/2004 6:17:00 PM

0

* Dave Thomas <Dave@PragProg.com> [2004-12-28 17:35:11 +0900]:

> 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.

--
Jim Freeze
Code Red. Code Ruby


Dave Thomas

12/29/2004 3:57:00 AM

0


On Dec 28, 2004, at 12:16 PM, jim@freeze.org wrote:
> 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



Cameron McBride

1/9/2005 2:27:00 AM

0

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