FXRuby is a Ruby extension module that provides an interface to the FOX GUI library.
During installation in Ubuntu, I ran into several small problems - that's why I will summarize the installation here, in case that anyone else gets stuck during installation.
First of all, you have to install all required Ruby libraries (using apt-get or aptitude or whatever):
- irb (Interactive RuBy, this is optional)
- libwebrick-ruby (needed for gem_server)
You will also need the Fox Toolkit, of course. Since the repository only includes a binary for Fox 1.0, you will need to download and compile a newer Version yourself.
Get version 1.2 from here:
I recommend version 1.2, since it is (as far as I know) the latest version which is supported by FXRuby.
Now, you should be able to install it the usual way:
This has the disadvantage that this Fox version won't be listed in the apt-repository (which would be handy for a deinstallation).
tar -xvzf fox-1.2.16.tar.gz
sudo make install
So I recommend you install 'checkinstall' (which can be found in 'universe'). This tool will monitor the installation progress and will then create a package which will be listed in the apt-repository.
So, after installation of 'checkinstall', you should use the following command instead of the above:
And the rest will be done automatically.
tar -xvzf fox-1.2.16.tar.gz
sudo checkinstall -D
If the installation fails because some X header files are missing, you'll have to install the following package: xlibs-dev (it should be in the Ubuntu repositories).
If compilation succeeded, you have to make your system aware of the fox library, so that FXRuby can find the library later on.
One way to do this is to modify the LD_LIBRARY_PATH environment variable to include the directory where libFOX-1.2.so is installed. For example, if libFOX-1.2.so is installed in /usr/local/lib (which will normally be the case), try setting:
If this works, you can of course permanently add the LD_LIBRARY_PATH setting to your login file(s) so that you don't have to remember to type it each time. Another approach that should work for Linux is to modify your /etc/ld.so.conf file to include the installation directory (e.g. /usr/local/lib). If you'd like to do this instead, you'll need to (as root):
- Edit your /etc/ld.so.conf file and add the directory where libFOX.so is installed; and,
- At the shell prompt, type ldconfig to reload the linker configuration.
Now that the Fox Toolkit is installed, you have to install RubyGems, Ruby's packaging system. You could install FXRuby directly, but the Gems system makes it easier to upgrade your Ruby extensions, or to install several versions of one extension simultaneously. Unfortunately, RubyGems cannot be found in the Ubuntu repositories.
But you can get it from http://rubygems.rubyforge.org and run (as root, if appropriate and necessary)
That should suffice for RubyGems to work!
Now, finally, we are able to install FXRuby. Run the following command:
You are then prompted for the version you would like to install -- choose the latest (at the time of this writing, this was fxruby 1.2.6).
sudo gem install fxruby
Compilation will take several minutes. On my system, I received lots of warnings during compilation -- but as long as it does not stop with an error, you can ignore them.
If you installed irb at the beginning, you can now use it to test your FXRuby installation. Start irb and type in the following:
If it works that far, FXRuby should have been successfully installed -- congratulations!!
irb(main):001:0> require 'rubygems'
irb(main):002:0> require_gem 'fxruby'
irb(main):003:0> include Fox