# Installation question

**URL:** <https://www.ruby-forum.com/t/installation-question/95346>\
**Category:** Ruby\
**Created:** [May 29, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/installation-question/95346 "2006-05-29T19:08:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 29, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/installation-question/95346/1 "2006-05-29T19:08:28Z")

</div>

I use Mac OS and have installed Ruby. Sorry for a stupid question but  
where is Ruby installed?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 29, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/installation-question/95346/2 "2006-05-29T19:31:51Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> I use Mac OS and have installed Ruby. Sorry for a stupid question but  
> where is Ruby installed?

I seem to have the main Ruby folder in /usr/lib/ruby. Is that the  
correct place?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 29, 2006, 11:43pm UTC](https://www.ruby-forum.com/t/installation-question/95346/3 "2006-05-29T23:43:58Z")

</div>

% which ruby

-austin

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 29, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/installation-question/95346/4 "2006-05-29T23:47:28Z")

</div>

On 5/29/06, Pål Bergström [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Pål Bergström wrote:
> 
> > I use Mac OS and have installed Ruby. Sorry for a stupid question but  
> > where is Ruby installed?
> 
> I seem to have the main Ruby folder in /usr/lib/ruby. Is that the  
> correct place?

Probably. I don’t have a mac, yet.

-austin

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 29, 2006, 7:41pm UTC](https://www.ruby-forum.com/t/installation-question/95346/5 "2006-05-29T19:41:28Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> I use Mac OS and have installed Ruby. Sorry for a stupid question but  
> where is Ruby installed?

I have a ruby file in /usr/local/bin. Why?

This is a bit messy and not so straightforward and simple as I thought  
it would be (and perceived Rails to be).

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 29, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/installation-question/95346/6 "2006-05-29T23:47:44Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> PÃ¥l BergstrÃ¶m wrote:
> 
> > I use Mac OS and have installed Ruby. Sorry for a stupid question but  
> > where is Ruby installed?
> 
> I seem to have the main Ruby folder in /usr/lib/ruby. Is that the  
> correct place?

OS X 10.4.x comes with Ruby pre-installed in /usr. If you installed Ruby  
from source (./configure && make && make install) then you installed  
that version of Ruby in /usr/local. You can always determine which ruby  
you’re using by running

which ruby

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 30, 2006, 8:44am UTC](https://www.ruby-forum.com/t/installation-question/95346/7 "2006-05-30T08:44:07Z")

</div>

Matthew S. wrote:

> On May 29, 2006, at 21:56, Pï¿½l Bergstrï¿½m wrote:

> So, once you’ve installed ruby from source (which you should do, the  
> version pre-installed on OSX is both old and slightly broken), you  
> will find things in the following places:
> 
> /usr/bin/ruby, /usr/lib/ruby - OSX included installations. Do not  
> touch!
> 
> /usr/local/bin/ruby - ruby interpreter  
> /usr/local/bin/irb - interactive shell  
> /usr/local/lib/ruby/1.8 - libraries for ruby 1.8  
> /usr/local/lib/ruby/site\_ruby - standard location for extra libraries  
> you might install  
> (and if you install rubygems)  
> /usr/local/lib/ruby/gems - where gems get installed
> 
> If you haven’t done so to begin with, I’d suggest finding a good set  
> of instructions for setting up Ruby and Rails. This one is pretty  
> comprehensive, especially when it comes to setting up paths (which is  
> pretty important):
> 
> [Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger)
> 
> I will warn you that in the last few months a couple of the  
> cut’n’paste installation steps have gone slightly out of date - it  
> ought to be simple enough to find the downloads you need from the  
> URLs given, though.
> 
> As a last warning - you shouldn’t put your own work (whether it’s  
> Rails, plain ruby, or any other language) under the /usr  
> directories. Keep it somewhere under your home directory, or you’ll  
> risk losing it all when you run Software Update.
> 
> best of luck,  
> matthew smillie.
> 
> Addendum:
> 
> On May 29, 2006, at 22:41, Austin Z. wrote:
> 
> > % which ruby
> 
> This will show you which version of ruby appears first in your path.  
> If everything’s set up correctly, it should say “/usr/local/bin/ruby”.

Thanks for an excellent explanation Matthew. 🙂 This helps me a lot.

I installed using the hivelogic article. But as I got problems with  
Eclipse and RadRails to actually create the files in Rails (as I can do  
using the terminal) I got suspicious and wondered if I’ve done it right.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [May 30, 2006, 12:31am UTC](https://www.ruby-forum.com/t/installation-question/95346/8 "2006-05-30T00:31:21Z")

</div>

On May 29, 2006, at 21:56, Pål Bergström wrote:

> Pål Bergström wrote:
> 
> > I use Mac OS and have installed Ruby. Sorry for a stupid question but  
> > where is Ruby installed?
> 
> I have a ruby file in /usr/local/bin. Why?
> 
> This is a bit messy and not so straightforward and simple as I thought  
> it would be (and perceived Rails to be).

This is, in fact, entirely normal. The file in /usr/local/bin is the  
ruby interpreter that you compiled and installed. Not only is it  
normal for ruby, it’s normal for installing things under unix in  
general.

Ruby (like most any language) has several distinct parts, which live  
in several places in the file structure which, for OSX, is pretty  
similar to the various flavours of unix. Like most languages  
installed under unix, there isn’t really a ‘main folder’: the  
binaries (commands/executables or whatever you’d prefer to call them,  
like the actual ruby interpreter, and the irb interactive shell) live  
in one place (‘bin’), and the libraries live in another place (‘lib’).

The default location for these directories is under the /usr  
directory, so /usr/bin/ruby is the default location for the ruby  
interpreter for OSX, and the default libraries live at /usr/lib/ruby.

When you compile ruby from source, it will install under /usr/local/  
bin and /usr/local/lib. /usr/local is the one of the more-standard  
unixy places to install things you’ve compiled yourself. Under OSX,  
it’s probably best to stick to this location, and not overwrite the  
default OSX install in /usr/bin and /usr/lib.

So, once you’ve installed ruby from source (which you should do, the  
version pre-installed on OSX is both old and slightly broken), you  
will find things in the following places:

/usr/bin/ruby, /usr/lib/ruby - OSX included installations. Do not  
touch!

/usr/local/bin/ruby - ruby interpreter  
/usr/local/bin/irb - interactive shell  
/usr/local/lib/ruby/1.8 - libraries for ruby 1.8  
/usr/local/lib/ruby/site\_ruby - standard location for extra libraries  
you might install  
(and if you install rubygems)  
/usr/local/lib/ruby/gems - where gems get installed

If you haven’t done so to begin with, I’d suggest finding a good set  
of instructions for setting up Ruby and Rails. This one is pretty  
comprehensive, especially when it comes to setting up paths (which is  
pretty important):

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

I will warn you that in the last few months a couple of the  
cut’n’paste installation steps have gone slightly out of date - it  
ought to be simple enough to find the downloads you need from the  
URLs given, though.

As a last warning - you shouldn’t put your own work (whether it’s  
Rails, plain ruby, or any other language) under the /usr  
directories. Keep it somewhere under your home directory, or you’ll  
risk losing it all when you run Software Update.

best of luck,  
matthew smillie.

Addendum:

On May 29, 2006, at 22:41, Austin Z. wrote:

> % which ruby

This will show you which version of ruby appears first in your path.  
If everything’s set up correctly, it should say “/usr/local/bin/ruby”.
