So, I loaded Ruby on a NetBSD box, using whatever the defaults are
for NetBSD's pkgsrc system.
I have 'ri', but it doesn't know about any of the standard library
classes or built-ins. So, "ri Array" says it's never heard of it,
same with "ri CGI". Addons (gems, for instance) all show up fine.
# I have 'ri', but it doesn't know about any of the standard library
# classes or built-ins. So, "ri Array" says it's never heard of it,
# same with "ri CGI".
it should.
root@pc4all:~# qri Array
----------------------------------------------------------- Class: Array
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.
ri looks in a few places by default: the system's docs, the site docs (in an ri directory) and user docs (in a hidden dot dir in user's home dir).
Mine look like this on OS X :
/usr/local/share/ri/1.8/site
/usr/local/share/ri/1.8/system
I could have (local only to my home dir) but don't have :
~/.rdoc/
To find your data directory:
ruby -r rbconfig -e 'p Config::CONFIG["datadir"]'
Mine is :
/usr/local/share/
This is the same location as my system's man pages.
You may have to add docs to ri yourself. (it seems...)
you need to run rdoc
One file at a time:
rdoc --ri filename.rb filename2.rb
Ruby's standard library and built in classes and modules:
rdoc --ri-system
(need to be in the Ruby source code directory, probably: /lib
maybe /lib/ruby )
···
On May 11, 2007, at 12:16 PM, Peña, Botp wrote:
From: seebs@seebs.net [mailto:seebs@seebs.net]
# I have 'ri', but it doesn't know about any of the standard library
# classes or built-ins. So, "ri Array" says it's never heard of it,
# same with "ri CGI".
it should.
root@pc4all:~# qri Array
----------------------------------------------------------- Class: Array
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.
This is the same location as my system's man pages.
Mine too.
You may have to add docs to ri yourself. (it seems...)
you need to run rdoc
Ruby's standard library and built in classes and modules:
rdoc --ri-system
(need to be in the Ruby source code directory, probably: /lib
maybe /lib/ruby )=
I can't find a directory in which this doesn't say "No newer files".
More disturbingly, if I go into the source/lib directory and run, e.g.,
"rdoc cgi.rb", I can't figure out where the created file is GOING. Not,
in any event, into the system ri directory, or anywhere that 'ri CGI'
can find it.
Ahh! Going into the build directory and running 'make install-doc'
has fixed it. I'll send a bug report to the NetBSD package maintainer
that this ought to be at least an option for the package, and probably
the default.
Sometimes packages are unreliable. It's a pain, but manual installs get you the details (no choice but details!). Especially since many systems are so similar yet different.
This is the same location as my system's man pages.
Mine too.
You may have to add docs to ri yourself. (it seems...)
you need to run rdoc
Ruby's standard library and built in classes and modules:
rdoc --ri-system
(need to be in the Ruby source code directory, probably: /lib
maybe /lib/ruby )=
I can't find a directory in which this doesn't say "No newer files".
More disturbingly, if I go into the source/lib directory and run, e.g.,
"rdoc cgi.rb", I can't figure out where the created file is GOING. Not,
in any event, into the system ri directory, or anywhere that 'ri CGI'
can find it.
Ahh! Going into the build directory and running 'make install-doc'
has fixed it. I'll send a bug report to the NetBSD package maintainer
that this ought to be at least an option for the package, and probably
the default.