How to use ri in my computer?

[email protected]:~$ ri Integer#times
/usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:384:in initialize': Permission denied - /home/pt/.ri/cache/.doc_dirs (Errno::EACCES) from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:384:inopen’
from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:384:in
create_class_cache' from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:371:inclass_cache’
from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:591:in block in run' from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:590:ineach’
from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:590:in run' from /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:300:inrun’
from /usr/local/ruby/bin/ri:5:in `’
[email protected]:~$ sudo ri Integer#times
[sudo] password for pt:
sudo: ri: command not found
[email protected]:~$ sudo /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri
Integer#times
sudo: /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri: command not found
[email protected]:~$ cd /usr/local/ruby/lib/ruby/1.9.1/rdoc/ri
[email protected]:/usr/local/ruby/lib/ruby/1.9.1/rdoc/ri$ ls
cache.rb display.rb formatter.rb reader.rb writer.rb
descriptions.rb driver.rb paths.rb util.rb
[email protected]:/usr/local/ruby/lib/ruby/1.9.1/rdoc/ri$

why can’t i use my ri?how can i do?

Hello Pen,

2010/4/8 Pen T. [email protected]:

[email protected]:~$ ri Integer#times
/usr/local/ruby/lib/ruby/1.9.1/rdoc/ri/driver.rb:384:in `initialize’:
Permission denied - /home/pt/.ri/cache/.doc_dirs (Errno::EACCES)

It seems that there are some directory you can’t read in ~/.ri.
Try

sudo chown -R pt home/pt/.ri

to recursively regain access to the directories, it should solve at
least this issue.

Cheers,

sudo find / -name ‘ri’
the following is what i get
/usr/local/ruby/lib/ruby/1.9.1/rdoc/ri
/usr/local/ruby/lib/ruby/gems/1.9.1/doc/hpricot-0.8.2/ri
/usr/local/ruby/lib/ruby/gems/1.9.1/doc/rubygems-update-1.3.6/ri
/usr/local/ruby/lib/ruby/gems/1.9.1/doc/fastri-0.3.1.1/ri
/usr/local/ruby/lib/ruby/gems/1.9.1/doc/rubygems-1.3.6/ri
/usr/local/ruby/lib/ruby/gems/1.9.1/doc/nokogiri-1.4.1/ri
/usr/local/ruby/lib/ruby/gems/1.9.1/doc/fastercsv-1.5.3/ri
/usr/local/ruby/share/ri
/usr/local/ruby/bin/ri
/home/pt/ruby-1.9.1-p378/lib/rdoc/ri
/home/pt/ruby-1.9.1-p378/bin/ri
/home/pt/.gem/ruby/1.9.1/doc/mailfactory-1.4.0/ri
/home/pt/.gem/ruby/1.9.1/doc/ruport-util-0.14.0/ri
/home/pt/.gem/ruby/1.9.1/doc/mime-types-1.16/ri
/etc/bash_completion.d/ri

how can i do?

[email protected]:~$ ls -la /home/pt/.ri
total 20
drwxr-xr-x 3 root root 4096 2010-03-24 18:35 .
drwxr-xr-x 162 pt pt 12288 2010-04-09 21:40 …
drwxr-xr-x 2 root root 4096 2010-03-24 18:35 cache
[email protected]:~$ sudo chown -R pt home/pt/.ri
[sudo] password for pt:
chown: cannot access `home/pt/.ri’: No such file or directory
[email protected]:~$

how can i do?help me, think you

Hello Pen,

2010/4/8 Pen T. [email protected]:

sudo find / -name ‘ri’

The directory ‘ri’ is looking for is not called ‘ri’ but ‘.ri’ (note
the dot at the beginnining of the name that make the directory
‘invisible’ from a simple ‘ls’). Try

ls -la /home/pt/.ri

to look at it directly. What did the command

sudo chown -R pt home/pt/.ri

answer to you ?

Cheers,

2010/4/9 Pen T. [email protected]:

[email protected]:~$ ls -la /home/pt/.ri
total 20
drwxr-xr-x 3 root root 4096 2010-03-24 18:35 .
drwxr-xr-x 162 pt pt 12288 2010-04-09 21:40 …
drwxr-xr-x 2 root root 4096 2010-03-24 18:35 cache
[email protected]:~$ sudo chown -R pt home/pt/.ri
[sudo] password for pt:
chown: cannot access `home/pt/.ri’: No such file or directory
[email protected]:~$

Sorry, typo on my side. It should be read

sudo chown -R pt /home/pt/.ri

(forgot the root slash). That should work now.

Cheers,

it’s ok nox ,think you