From: Lyle Johnson Date: 2002-07-18T00:08:03+09:00 Subject: Re: Problems installing FX/Ruby Harry Ohlsen wrote: > First, I downloaded a binary RPM, but when I tried to run a simple FX/Ruby > script, I got an error saying the require of "fox" was failing. Had you previously installed the FOX RPMs for your system? FXRuby depends on being able to find the FOX shared library (libFOX.so). > So, I downloaded the source code and tried to build FX/Ruby from scratch. For > some reason, the code makes a number of calls to rb_gc_mark(), passing a > parameter, but in intern.h, that function doesn't take any parameters. This is discussed in the build instructions (http://www.fxruby.org/doc/build.html) under the heading "Things That Can Go Wrong". > In a desperate attempt to progress a little further, I hacked those calls to > remove the parameter that was being passed. I had to do this in two files. Ummm, no, that's very very bad. The calls were correct, Ruby's header files were wrong. You need to back out those changes (probably made to markfuncs.cpp and FXRuby.cpp). > After that, I was able to build and install the library. > > One strange thing was that it installed things in ... > > /usr/local/lib/site_ruby/1.6/1.6/ > > I would have expected only one "1.6" in there. I've never seen this nor has it ever been reported. Could be a bug in setup.rb? But you're correct that we want it to install the shared library part of FXRuby (i.e. the fox.so file) in your site_ruby/1.6/$PLATFORM directory and the platform-independent files in the site_ruby/1.6/fox directory. > Anyway, when I try to run the small script now, I get > > test01.rb:1:in `require': libFOX-1.0.so.0: cannot open shared object file: No > such file or directory - /usr/local/lib/site_ruby/1.6/1.6/i386-linux/fox.so > (LoadError) > from test01.rb:1 > > even though /usr/local/lib/site_ruby/1.6/1.6/i386-linux/fox.so exists and is > readable (and executable) by everyone. This may indicate that the dynamic loader can't find one of the shared libraries that fox.so depends on. One way to diagnose this problem is to use the "ldd" command, e.g. ldd /usr/local/lib/site_ruby/1.6/1.6/i386-linux/fox.so The output of ldd should list all of the shared libraries that fox.so depends on. If any are missing you need to get those installed first. For more information, see the "Things That Can Go Wrong" section of the build instructions, mentioned earlier. > I noticed that in the source files, where the references to rb_gc_mark() > appeared, it was #ifdef-ed for 1.7.2 versus anything earlier. Correct. The prototype for rb_gc_mark() has been fixed in the Ruby 1.7 header files but won't be fixed (I guess?) for Ruby 1.6. > Should I try moving to 1.7.2, or is my problem something more fundamental? No need to move to 1.7.2 (unless you just want to). FXRuby works OK with any Ruby version 1.6.x or later.