Fxruby won't play with mac OS 10.5.8 Anyone else notice this? Suggestions?

Hi, I’m new here. We are teaching a class using Ruby and have come to
the point where we want to use fxruby with our students. Several of our
students have macs for their own use at home. What we have found is that
fxruby simply won’t install on system 10.5.8. Short of upgrading to 10.6
(not an option for most) or downgrading an OS update (difficult) there
seems to be no fix. The problem seems to revolve around an inability to
compile or link libraries within the FOX toolkit itself. Reinstallations
of Ruby itself or rubygems from clean source code, different versioning
etc. are not a fix. Created a build environment for fxruby manually (as
per fxruby user guide) still fails at gem install time - and actually
before when trying to ‘make’ FOX. A mac system running 10.6 (Snow
Leopard) has no such problems and neither do some previous incarnations
of 10.5 before 10.5.8 (I’ve only been able to check two of these
however). Eight separate machines running 10.5.8 experience the same

I am wondering if this has gone unnoticed as I cannot find mention of it
elsewhere. Below is output from log files. If anyone has any suggestions
I would greatly appreciate them.

fxruby won’t install on mac 10.5.8

I can confirm this problem on eight separate macs running 10.5.8
Ruby gem version and ruby version does not help.
Compiling Ruby from source code first and doing a clean install does not
Macports install of Ruby does not help

It appears that the problem lies with Fox itself and 10.5.8
A standard gem install yields this

ERROR: Error installing fxruby:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install fxruby
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
extconf.rb:31:in `find_installed_fox_version’: couldn’t find FOX header
files (RuntimeError)
from extconf.rb:125

Setting up a mac build environment first (installing .png, .tiff,. .jpeg
support for Fox first from source code results in an error when trying
to make Fox) which of course in turn results in

ld: library not found for -lFOX-1.6
collect2: ld returned 1 exit status
make: *** [fox16.bundle] Error 1

when trying to install the gem. Trying older versions of Fox, no luck.
It appears that fox simply won’t build in OS 10.5.8 and thus gem install
of fxruby fails.

I found a fix for this problem. So for any others that encounter it,
here is the synopsis.

The problem building fxruby seems to be in all versions of leopard, not
just 10.5.8 and there is, infact, some documentation of this is one
googles fox16.bundle, there are several instances noted. The bottom line
is that the only build of fxruby that works on Leopard is one installed
using mac-ports. Also, Ruby itself must be installed via macports to
pair with this particular build of fxruby. This puts two rubies on a
machine. The OS included one in /usr/bin and the new mac-ports one in
/opt/local/bin where fxruby also gets installed via macports. This means
that you have to now prepend a line to all .rb files:
#!/opt/local/bin/ruby in order to use the macports ruby and fox. Or you
can edit your path variable via .profile so that /opt/local/bin comes
first in the path. Then even IRB will use the macports ruby and you can
require ‘fox16’ there too.

Simple install

  1. Xcode (Leopard version) for GCC
  2. Macports (Leopard Version) - remember to update and sync
  3. sudo port install ruby
  4. sudo port install rb-fxruby
  5. note the path when typing which ruby in terminal
  6. Change path variable via .profile edit (sudo open -t .profile) if
    need be

All of this is synthesized from several accounts of problems with
Leopard and fxruby and suggestions from Lyle J. himself in several
posts. I can confirm that these simple steps are all that is needed to
get a working ruby with fox on Leopard.