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):
Ruby itself:
- ruby
- libruby
- irb (Interactive RuBy, this is optional)
Additional libraries:
- build-essential
- xlibs-dev
- libyaml-ruby
- libzlib-ruby
- 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:
http://www.fox-toolkit.org/ftp/fox-1.2.16.tar.gz
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:
Code:
tar -xvzf fox-1.2.16.tar.gz
cd fox-1.2.16
./configure
make
sudo make install
This has the disadvantage that this Fox version won't be listed in the apt-repository (which would be handy for a deinstallation).
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:
Code:
tar -xvzf fox-1.2.16.tar.gz
cd fox-1.2.16
./configure
make
sudo checkinstall -D
And the rest will be done automatically.
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:
Code:
export LD_LIBRARY_PATH=/usr/local/lib
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:
Code:
sudo gem install fxruby
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).
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:
Code:
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require_gem 'fxruby'
=> true
irb(main):003:0> include Fox
=> Object
If it works that far, FXRuby should have been successfully installed -- congratulations!!
Bookmarks