On 5/10/02 9:20 PM, "ccos" <ccos / bigpond.com> wrote:

>> 
>> That's why it is better to use:
>> #!/usr/bin/env ruby   #note the space before ruby
>> This seems to work everywhere.
>> 
>> 
> hello,
> yeah they had it like that in the practical programmer book, and that's
> why i originally tried it with a space,  on my system, usr/bin/env is a
> file, and not a directory. is it a file in your example as well. what
> exactly is going on with the space?

It is a file. In fact it's a little program that executes whatever program
is passed to it on the command line. Hence the space. Think of it this way:
"I'm not sure where Ruby is on machine X but env is *always* in /usr/bin on
any Unix. So I will call env and pass it 'ruby' as a parameter. I'll let env
find Ruby and launch it."

Of course on Windows the whole line gets ignored and hopefully the registry
points to Ruby so the program still runs. This works until the user installs
REAL Basic and then it fails. But that's a problem with Windows.


i guess it's time for me to hit the
> unix books a little harder. i'm a bit stumped. anybody out there using
> ruby cgi scripts on os x?

What helps is to grab ManOpen from
http://www.clindberg.org/projects/ManOpen.html. It makes reading the Unix
docs so much easier. There is a similar utility on iDisk but I like ManOpen
a little better.

There really is a fair number of people using Ruby on OSX. Apple is going to
preinstall it in the server version of Jaguar so that number will increase
for sure.

O'Reilly has a Unix for Mac OS X users book coming out. In the meantime, it
*usually* works to pretend you are using FreeBSD. I've gotten lots of help
from the FreeBSD folks.
> p.s. maybe i'm using the wrong ruby? usr/local/bin has only two files in
> it ruby and irb. would this be the right ruby? i think it is?

Two binaries is right. Most of ruby on my machine is in a hierarchy under
/usr/local/lib. The binaries should know how to find the .dylibs where most
of Ruby's code actually is.

Here is the mantra for installing Ruby from the latest stable tarball:

1) Don't trust StuffIt! Use tar from the command line or OpenIt to
unarchive.

2) Call configure like this:
configure --enable-shared --mandir=/usr/local/share/man

There is some problem with the build wanting some X11 file if you are
running fink. I forget the details but ask again if that bites you.
-- 
Tact is the ability to describe others as they see themselves. -Abraham
Lincoln, 16th president of the U.S (1809-1865)