From: Matthew Smillie Date: 2006-05-30T07:28:08+09:00 Subject: Re: Installation question 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_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 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".