Problems installing FX/Ruby

I’m having problems getting FX/Ruby installed on Redhat 7.3 with Ruby 1.6.7.

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.

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.

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.
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.

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.

Obviously, at this stage, I’m very, very confused!

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.

Should I try moving to 1.7.2, or is my problem something more fundamental?

Thanks in advance,

Harry O.

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.
After that, I was able to build and install the library.

It's best to modify intern.h in this case.

If you remove the parameter to rb_gc_mark(), the GC will not work

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

It's trying to say that fox.so can't find libFOX-1.0.so.0 (or another
library)

Guy Decoux

I’m having problems getting FX/Ruby installed on Redhat 7.3 with Ruby 1.6.7.

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.

Obviously, at this stage, I’m very, very confused!

RTFM :slight_smile: The solution to this issue is detailed in doc/build.html under
the section titled “Things That Can Go Wrong”.

Regards,
Doug

···

On Wed, Jul 17, 2002 at 10:11:36PM +0900, Harry Ohlsen wrote:

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.

It’s trying to say that fox.so can’t find libFOX-1.0.so.0 (or another
library)

Strange. That file is in /usr/local/lib, so I don’t know why it can’t find
it. It’s a symbolic link to libFOX-1.0.so.0.0.14, which also exists.

Any ideas?

Strange. That file is in /usr/local/lib, so I don't know why it can't find
it. It's a symbolic link to libFOX-1.0.so.0.0.14, which also exists.

Do you have /usr/local/lib in /etc/ld.so.conf ?

Try

   /sbin/ldconfig -vNX

to see the search path

You can try also try to sue LD_LIBRARY_PATH

Guy Decoux

OK. I admit it … I’m a dickhead :slight_smile: !!

It turned out that while the library was in /usr/local/lib, that wasn’t in my
LD_LIBRARY_PATH. I’m surprised this hasn’t caused me a problem about a
million times before now, but I guess my luck’s just been very good.

Harry Ohlsen wrote:

OK. I admit it … I’m a dickhead :slight_smile: !!

It turned out that while the library was in /usr/local/lib, that wasn’t in my
LD_LIBRARY_PATH. I’m surprised this hasn’t caused me a problem about a
million times before now, but I guess my luck’s just been very good.

Sorry I posted a lengthy response to your original question before
checking to see if anyone had already responded; I’ve been out of town a
few days and am trying to catch on e-mails and such. Glad to hear that
this is working a little better now.