# Site\_ruby

**URL:** <https://www.ruby-forum.com/t/site-ruby/77283>\
**Category:** Ruby\
**Created:** [November 26, 2006, 2:56am UTC](https://www.ruby-forum.com/t/site-ruby/77283 "2006-11-26T02:56:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_DeLorme](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@Daniel\_DeLorme](https://www.ruby-forum.com/u/Daniel_DeLorme)\
**Post date:** [November 26, 2006, 2:56am UTC](https://www.ruby-forum.com/t/site-ruby/77283/1 "2006-11-26T02:56:07Z")

</div>

Can anyone explain what the site\_ruby directory is for? Why use that  
directory  
instead of /usr/local/lib/ruby/ ? Only rubygems seems to use that  
directory.

---

<div class="post-metadata">

**Author:** ![Daniel\_DeLorme](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@Daniel\_DeLorme](https://www.ruby-forum.com/u/Daniel_DeLorme)\
**Post date:** [November 26, 2006, 4:52am UTC](https://www.ruby-forum.com/t/site-ruby/77283/2 "2006-11-26T04:52:12Z")

</div>

Daniel DeLorme wrote:

> Can anyone explain what the site\_ruby directory is for? Why use that directory  
> instead of /usr/local/lib/ruby/ ? Only rubygems seems to use that directory.

Well, that’s a good question. One point is that /usr/local/lib/ruby is  
where ruby’s standard libs are installed (if local install, otherwise  
/usr/lib/ruby) it’s really only by the grace of the version folder  
(1.8) that gems can use this location cleanly. Unfortunately Debian  
packages completely ignore this distinction and install ruby packages  
right in there with the standard lib --which makes it impossible to  
distingusih standard libs from non-standard (not nice).

A recent discussion indicated that the the FHS would have us place  
these files in /usr/share/ruby or /usr/local/share/ruby. And sure  
enough that’s what Perl does --though it seems wrong to me. I would  
think /usr/lib/ruby/site and /usr/local/lib/ruby/site, along side gem,  
would be optimal.

T.

---

<div class="post-metadata">

**Author:** ![Daniel\_DeLorme](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@Daniel\_DeLorme](https://www.ruby-forum.com/u/Daniel_DeLorme)\
**Post date:** [November 26, 2006, 10:22am UTC](https://www.ruby-forum.com/t/site-ruby/77283/3 "2006-11-26T10:22:30Z")

</div>

On 11/26/06, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> /usr/lib/ruby) it’s really only by the grace of the version folder  
> (1.8) that gems can use this location cleanly. Unfortunately Debian  
> packages completely ignore this distinction and install ruby packages  
> right in there with the standard lib --which makes it impossible to  
> distingusih standard libs from non-standard (not nice).

Ahh I failed to notice, well I realized that apt-get was not going well  
with  
gem, good to know why.  
That amongst other problems I have posted about recently have driven me  
to  
switch from Sarge to Gentoo in our  
network of routers and firewalls.

A recent discussion indicated that the the FHS would have us place

> these files in /usr/share/ruby or /usr/local/share/ruby. And sure  
> enough that’s what Perl does --though it seems wrong to me. I would  
> think /usr/lib/ruby/site and /usr/local/lib/ruby/site, along side gem,  
> would be optimal.
> 
> T.

I use site\_ruby intensively to put my own libs, I thaught this was its  
main  
purpose, was I wrong?

Cheers  
Robert

–  
The reasonable man adapts himself to the world; the unreasonable one  
persists in trying to adapt the world to himself. Therefore all progress  
depends on the unreasonable man.

- George Bernard Shaw

---

<div class="post-metadata">

**Author:** ![Daniel\_DeLorme](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@Daniel\_DeLorme](https://www.ruby-forum.com/u/Daniel_DeLorme)\
**Post date:** [November 26, 2006, 11:30pm UTC](https://www.ruby-forum.com/t/site-ruby/77283/4 "2006-11-26T23:30:39Z")

</div>

Robert D. wrote:

> On 11/26/06, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > /usr/lib/ruby) it’s really only by the grace of the version folder  
> > (1.8) that gems can use this location cleanly. Unfortunately Debian  
> > packages completely ignore this distinction and install ruby packages  
> > right in there with the standard lib --which makes it impossible to  
> > distingusih standard libs from non-standard (not nice).
> 
> Ahh I failed to notice, well I realized that apt-get was not going well  
> with  
> gem, good to know why.  
> That amongst other problems I have posted about recently have driven me  
> to  
> switch from Sarge to Gentoo in our  
> network of routers and firewalls.

It’s possible to mix the two just fine.

Install ruby from apt normally.

When you install rubygems just use something like:

ruby setup.rb --prefix=/usr/local --siteruby=/usr/local/lib/site\_ruby

Then add /usr/local/lib/site\_ruby/1.8/gems/bin to the $PATH

Everything behaves as expected.

I wish there was a way to specifc where rubygems put the executables of  
gems it installs. then I would just set it to /usr/local/bin and not  
bother with having to modify $PATH but I haven’t found a way to do that
