# Getting Started w Ruby on MacOSX -- ri/RDoc error

**URL:** <https://www.ruby-forum.com/t/getting-started-w-ruby-on-macosx-ri-rdoc-error/180936>\
**Category:** Ruby\
**Created:** [January 1, 2010, 1:05am UTC](https://www.ruby-forum.com/t/getting-started-w-ruby-on-macosx-ri-rdoc-error/180936 "2010-01-01T01:05:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MSNorton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@MSNorton](https://www.ruby-forum.com/u/MSNorton)\
**Post date:** [January 1, 2010, 1:05am UTC](https://www.ruby-forum.com/t/getting-started-w-ruby-on-macosx-ri-rdoc-error/180936/1 "2010-01-01T01:05:48Z")

</div>

Hello,

I’ve done some poking around and haven’t yet found a satisfactory  
answer to this problem and it’s starting to be troublesome.

My development machine run MacOSX and I’ve installed Ruby 1.9.1 via  
the MacPorts options. This puts everything into /opt/local and tags  
executables with the version number (e.g. ruby becomes ruby1.9, ri  
becomes ri1.9, etc.)

When I run ri to browse a class documentation, I get the following  
error:

galactica:~ remillard$ ri GC  
/opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:384:in `initialize': Permission denied - /Users/remillard/.ri1.9/cache/.doc_dirs (Errno::EACCES) from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:384:in`open’  
from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:384:in  
`create_class_cache' from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:371:in`class\_cache’  
from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:591:in `block in run' from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:590:in`each’  
from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:590:in `run' from /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:300:in`run’  
from /opt/local/bin/ri:5:in `’

Now, my best guess is that there’s something funny about the paths  
where MacPorts installed things, but I’ll be damned if I can figure  
out what’s going on. When looking at my path I see:

galactica:~ remillard$ echo $PATH  
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/  
local/bin:/usr/X11/bin:/Users/remillard/bin

And it looks to me like the MacPorts path should be searched first.  
The only thing I did was to go into /opt/local/bin and symlink the  
simple names to the versioned names for convenience. However I still  
get the same error if I run “ri1.9 GC” so I don’t think the symlinks  
are causing any trouble.

Has anyone run into this with MacPorts, Ruby 1.9 and MacOSX?

Thanks for any information and help the community can suggest.

Best regards,  
Mark Norton

---

<div class="post-metadata">

**Author:** ![MSNorton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@MSNorton](https://www.ruby-forum.com/u/MSNorton)\
**Post date:** [January 1, 2010, 1:35am UTC](https://www.ruby-forum.com/t/getting-started-w-ruby-on-macosx-ri-rdoc-error/180936/2 "2010-01-01T01:35:39Z")

</div>

I did finally figure it out so I will document the answer here in case  
it helps someone else.

Somewhere along the line with installing ruby, rails, and other gems,  
the local ri cache was created and owned by root. I’m not entirely  
sure why, but that explained the lack of permissions. If you get  
errors similar to what I described above, check your local directory  
“ls -al” and look to see if root owns .ri1.9/. Blow that away and  
then rerun ri. It’ll rebuild the cache and hopefully be owned by your  
own self.

Hope this helps.

All the best,  
Mark Norton

---

<div class="post-metadata">

**Author:** ![MSNorton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@MSNorton](https://www.ruby-forum.com/u/MSNorton)\
**Post date:** [January 2, 2010, 2:25am UTC](https://www.ruby-forum.com/t/getting-started-w-ruby-on-macosx-ri-rdoc-error/180936/3 "2010-01-02T02:25:38Z")

</div>

On Dec 31, 2009, at 16:05 , M. Norton wrote:

> When I run ri to browse a class documentation, I get the following  
> error:
> 
> galactica:~ remillard$ ri GC  
> /opt/local/lib/ruby1.9/1.9.1/rdoc/ri/driver.rb:384:in `initialize’:  
> Permission denied - /Users/remillard/.ri1.9/cache/.doc\_dirs  
> (Errno::EACCES)

Did you install the docs?

---

<div class="post-metadata">

**Author:** ![MSNorton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@MSNorton](https://www.ruby-forum.com/u/MSNorton)\
**Post date:** [January 14, 2010, 10:19pm UTC](https://www.ruby-forum.com/t/getting-started-w-ruby-on-macosx-ri-rdoc-error/180936/4 "2010-01-14T22:19:41Z")

</div>

M. Norton wrote:

> I did finally figure it out so I will document the answer here in case  
> it helps someone else.
> 
> Somewhere along the line with installing ruby, rails, and other gems,  
> the local ri cache was created and owned by root. I’m not entirely  
> sure why, but that explained the lack of permissions. If you get  
> errors similar to what I described above, check your local directory  
> “ls -al” and look to see if root owns .ri1.9/. Blow that away and  
> then rerun ri. It’ll rebuild the cache and hopefully be owned by your  
> own self.
> 
> Hope this helps.
> 
> All the best,  
> Mark Norton

Hi,

Just wanted to let you know you helped someone. Ran into the exact same  
problem on Mint linux today, and your post came up with a little  
googling.

A simple “sudo chown -R aaron:aaron /home/aaron/.ri1.9.1/” saved the  
day!

Aaron
