[fxruby-users] Installing RubyFX on MacOS X 10.4.3
r.fulton at auckland.ac.nz
Sat Nov 26 14:16:51 EST 2005
OK, I just got hello world up on the screen! It only took about 20 hours :)
It turns out that the install is reasonably straight forward so long as
you don't first shoot yourself in both feet by having two Ruby installs
on your machine ;)
When I starter paying with ruby I had not realised that tiger installed
ruby and so I had installed it from fink and by the time I came to play
with FXRuby I had forgotten this. Once I used dselect to remove the
fink version of Ruby thing started working much better. This also
explained why I was able to compile extensions without running the the
There are still issues with the graphics libraries and these can be very
confusing and difficult to diagnose. The problem being that fox and
builds quite happily without them but things come unstuck with FXRuby
because it assumes they are in the links are in fox.bundle so you either
get an error running install.rb setup or when you run any fxruby app
(depending on the exact circumstance).
It would be helpful if the fxruby config step could check for the
existence of the routines in foxlib and give plain English statement of
One other complication is that not only do you need the libraries you
also need the include files to build foxlib properly. Fink does not
have dev versions of any of the libraries (i.e. the fink packages do
*not* include the header files). It is therefore best to install all
the image libraries from source. There are convenient links to the
necessary tar balls on the fox download page -- I also installed zlib
The last piece of the puzzle is that (for reasons unknown and possibly
specific to my setup) the libjpeg.a file that I installed had something
screwed with its table of contents and I had to run ranlib to fix this.
So I ended up taking much longer than I should have to do what is really
quite a straight forward job. One other thing that tripped me up was
that I ended up with some libraries installed in /usr/local and some in
/sw (why oh why does fink install stuff in /sw?? NO I really don't want
to know ;) my powerbook is now covered in bloody footprints ;) My
excuse is that this is the first time I have tried to install any
substantial software from source under Mac OS. Oh yes, I'm also getting
old and stupid :)
So how does one go about installing fox/fxruby on MacOS 10.4?
1/ Install Apple Xcode tools (if not already installed) and copy the
tarballs for fox and fxruby to somewhere convenient.
2/ You also need to download and run the fix script so that the Apple
supplied ruby can build extensions.
sudo gem install fixrbconfig
3/ check the prerequisite libraries (png, tiff and jpeg) *and* include
files in both /usr/local and /sw (libraries in lib/ and include in
include/ -- files in lib/ have lib prepended to the name e.g. libpng).
If any are missing then rebuild that package from source (links on the
the fox download page). All packages install in /usr/local by default
so if you have installed the from fink but are missing the include files
the use dselect to uninstall them first.
I had to run ranlib on libjpeg.a:
sudo ranlib /usr/local/lib/libjpeg.a
now you should be able to install fox and fxruby following the usual
The key to a successful install is to have the graphic libraries all
present and correct *before* you start installing fox.
Lyle: Please feel free to use this material to update the fxruby
install web pages.
One last note: When I did my final build of fox.bundle (which I did by
descending into ext/fox, removing fox.bundle and running make) I got a
whole bunch of duplicate symbol warning for various tiff routines which
ld found in both libtiff and libfox. I'm not sure what that was about
but the fox.bundle that resulted seems to work just fine.
More information about the fxruby-users