Installation question

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

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?

% which ruby

-austin

On 5/29/06, Pål Bergström [email protected] 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

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).

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

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

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. :slight_smile: 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.

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):

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”.