How to install something on MacOS X?

P

pete boardman

So far I've been learning Ruby (1.8.2 as pre-installed on Mac/Tiger)
without any installation or command-line worries, but now I've
decided to investigate a library called 'ruby/graphviz'. I downloaded
it but I don't know how to install it. (There are no instructions,
but then that might be because there's a standard way of doing it...)

I've got these files/directories:

/ruby-graphviz/lib/
/ruby-graphviz/IMPORTANT
/ruby-graphviz/COPYING
/ruby-graphviz/AUTHORS
/ruby-graphviz/extconf.rb
/ruby-graphviz/tests/
/ruby-graphviz/README

Only the extconf.rb file looks like it might do something re
installation, but when run it says:

can't find header files for ruby.

Suggestions welcomed!

-
Pete
 
P

pete boardman

Have you tried to get Ruby stuff from DarwinPorts?

No. I've just been using everything as supplied by Apple, then
downloaded ruby-graphviz_0.6.0.tar. I was expecting to have to create
a folder or two, or copy some files or something. I hope adding
extensions to Ruby isn't going to be as hard as installing TeX ... :)

Pete
 
M

Matthew Smillie

So far I've been learning Ruby (1.8.2 as pre-installed on Mac/
Tiger) without any installation or command-line worries, but now
I've decided to investigate a library called 'ruby/graphviz'. I
downloaded it but I don't know how to install it. (There are no
instructions, but then that might be because there's a standard way
of doing it...)

I've got these files/directories:

/ruby-graphviz/lib/
/ruby-graphviz/IMPORTANT
/ruby-graphviz/COPYING
/ruby-graphviz/AUTHORS
/ruby-graphviz/extconf.rb
/ruby-graphviz/tests/
/ruby-graphviz/README

Only the extconf.rb file looks like it might do something re
installation, but when run it says:

can't find header files for ruby.

Suggestions welcomed!

You'll need to do the following to install:

1. install the developer tools (the cause of your immediate error, I
expect) You can get them from the Tiger DVD, or as a download from
Apple with a (free) registration to their developer site.

2. To install graphviz, do as follows:

ruby extconf.rb
make
sudo make install

You're right thinking this is a fairly standard way of doing things,
but most libraries do come with slightly more explicit instructions.

Once you've done that, you might consider installing a new ruby,
either from source, or using fink (fink.sf.net) or darwinports
(darwinports.opendarwin.org) if they're more convenient. The Ruby
that ships with Tiger is very slightly broken, and installing the
current stable version could save you from some mysterious headaches
in the future. There's also a fair number of ruby packages available
on both systems (though not always the most up-to-date versions).

I'm fairly sure that some functions of ruby-graphviz rely on graphviz
already being installed on the system. You can get it through fink/
darwinports as well, I imagine.

hope this helps,
matthew smillie.
 
T

Timothy Hunter

pete said:
So far I've been learning Ruby (1.8.2 as pre-installed on Mac/Tiger)
without any installation or command-line worries, but now I've decided
to investigate a library called 'ruby/graphviz'. I downloaded it but I
don't know how to install it. (There are no instructions, but then that
might be because there's a standard way of doing it...)

I've got these files/directories:

/ruby-graphviz/lib/
/ruby-graphviz/IMPORTANT
/ruby-graphviz/COPYING
/ruby-graphviz/AUTHORS
/ruby-graphviz/extconf.rb
/ruby-graphviz/tests/
/ruby-graphviz/README

Only the extconf.rb file looks like it might do something re
installation, but when run it says:

can't find header files for ruby.

Suggestions welcomed!
Typically, Ruby extensions that are compiled (as opposed to pure-Ruby
extensions) will require access to the Ruby header files. You don't get
these with just the pre-installed Ruby. You'll have to download and
install Ruby yourself. As part of doing that the installation procedure
will copy the header files to the directory that extconf.rb looks for
them in.

I've never installed ruby-graphviz but just looking at extconf.rb it
seems that (once you have the Ruby headers installed) you'll have to run
these two commands:

ruby extconf.rb
sudo make install

I won't make any excuses for the lack of documentation - it seems that
the ruby-graphviz developer assumed that interested parties would be
motivated and able to figure it out for themselves. FWIW this is a
fairly standard procedure.

Fortunately ruby-graphviz appears to be simple to install. There are
some that are much, much harder.

Good luck!
 
P

pete boardman

Helpful said:
Typically, Ruby extensions that are compiled (as opposed to pure-
Ruby extensions) will require access to the Ruby header files. You
don't get these with just the pre-installed Ruby. You'll have to
download and install Ruby yourself. As part of doing that the
installation procedure will copy the header files to the directory
that extconf.rb looks for them in.
The Ruby that ships with Tiger is very slightly broken, and
installing the current stable version could save you from some
mysterious headaches in the future.

Thanks! That defines both the problem and the solution neatly. I'll
get going on some downloads.

bye

Pete
 
E

Eric Hodel

Typically, Ruby extensions that are compiled (as opposed to pure-
Ruby extensions) will require access to the Ruby header files. You
don't get these with just the pre-installed Ruby. You'll have to
download and install Ruby yourself.

Wrong.

$ locate ruby.h | grep '/usr/lib'
/usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h

Tiger's Ruby is slightly broken, there's a gem to fix it, but I don't
recall its name.
 
M

Mark Hubbart

Wrong.

$ locate ruby.h | grep '/usr/lib'
/usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h

Yes, also: they get installed with the dev tools, as someone suggested earl=
ier.
Tiger's Ruby is slightly broken, there's a gem to fix it, but I don't
recall its name.

install rubygems, then:

sudo gem install fixrbconfig; sudo fixrbconfig

cheers,
Mark
 
M

Matthew Smillie

install rubygems, then:

sudo gem install fixrbconfig; sudo fixrbconfig

Unfortunately, this isn't a complete solution to Tiger's Ruby
problem. It does fix readline and lets you install and use Rails
successfully (which was the problem which inspired the fix), but it
doesn't solve problems with Array#pack (I think it was pack - feel
free to offer corrections). Anecdotally: ruby-wordnet's convertdb.rb
script will create a segmentation fault on both the 'fixed' and
unfixed systems. (the script convert's Wordnet's database to a
slightly different format).

This makes me believe that in order to completely fix that problem,
you will need to roll your own, or install via some sort of package.

matthew smillie.
 
B

Brian Mitchell

Unfortunately, this isn't a complete solution to Tiger's Ruby
problem. It does fix readline and lets you install and use Rails
successfully (which was the problem which inspired the fix), but it
doesn't solve problems with Array#pack (I think it was pack - feel
free to offer corrections).

They somehow messed up the endianess of the pack and unpack
operations. They are completely backwards. I wondered if this had
anything to do with their intel development work? They have not fixed
it and show no sign of it ever being fixed during Tiger's life cycle.

I _highly_ recommend you install from source yourself.

Brian.
 
R

Rawn027

Michael said:
The Ruby-WordNet problem is a bug in the conversion script. I've
committed a fix for it which you can see at:

http://deveiate.org/projects/Ruby-WordNet/changeset/60

I should have a new release packaged up this weekend, along with a gem
that should fix the problem.

If I installed Ruby 1.8.3 from source, will I have any problems or do I
need to run a fix? I am asking because if i try to run the fix it is
broken now on 10.4.3 and will not run because the location of ruby.h
has changed. I currently just want to do some small rails development
with mysql.
 
M

Michael Granger

Ruby-Wordnet doesn't use any C components so it doesn't care where your
ruby.h is. The segfault in the distributed version is from an incorrect
use of BerkeleyDB's transactions, which is completely unrelated to the
Tiger problem.

Sorry for the confusion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top