Forum: Ruby Installation question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2006-05-29 19:08
I use Mac OS and have installed Ruby. Sorry for a stupid question but
where is Ruby installed?
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2006-05-29 19:31
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?
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2006-05-29 19:41
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).
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-05-29 23:43
(Received via mailing list)
% which ruby

-austin
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-05-29 23:47
(Received via mailing list)
On 5/29/06, Pål Bergström <pal@palbergstrom.com> 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
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Timothy Hunter (Guest)
on 2006-05-29 23:47
(Received via mailing list)
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
31af45939fec7e3c4ed8a798c0bd9b1a?d=identicon&s=25 Matthew Smillie (Guest)
on 2006-05-30 00:31
(Received via mailing list)
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):

http://hivelogic.com/articles/2005/12/01/ruby_rail...

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 Ziegler 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".
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2006-05-30 08:44
Matthew Smillie 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):
>
> http://hivelogic.com/articles/2005/12/01/ruby_rail...
>
> 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 Ziegler 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.
This topic is locked and can not be replied to.