Ruby/Gtk    Installation & setup help

Add Gtk to an existing MinGW-based Ruby interpreter

  1. Download the gtk libraries and, if you don't already have it, also download unzip32.exe.  Place them one directory level higher than where the interpreter executable file, ruby.exe, lives.  A listing of this directory will display the subdirectories bin, lib, and doc.  Make sure you are in the right place before continuing.  If you're lost, a search under "My Computer" for ruby.exe might help.
  2. In a console window, go to the directory where you just placed the new files, and unzip the Gtk libraries:
        unzip32 gtk-dlls.20001226
  3. Find out whether you have the binding code already, and if so, what version it is, using this command:
        ruby -rgtk -e 'p Gtk::BINDING_VERSION'
    This should report [0, 2, 7].  If you get an error, or if an earlier version such as [0, 2, 5] is reported, then download the current binding code, place it in the same directory we were just describing, and unzip it with this command:
        unzip32 ruby-gtk-0.27-mingw

Now you should be able to run the Ruby/Gtk examples from the book and from the doc/ruby/gtk-0.27/sample directory.

If you want to make the Gtk libraries available to applications other than just your Ruby interpreter, you can copy them to your system directory, which is typically C:\WINDOWS\SYSTEM32 or C:\WINNT\SYSTEM32.  (The book erroneously points you to SYSTEM; this generally works okay, but is really intended for compatibility with some older windows applications.  SYSTEM32 is preferable.)

Note: If you're running the MinGW-based interpreter under Windows 95, 98, or ME, then you must copy the Gtk libraries to the WINDOWS\SYSTEM32 directory, or the interpreter won't be able to find them.  This is not necessary if you are using the Cygwin-based interpreter, or have Windows NT, 2000, or XP.

Files kept here

Self-contained (unzip and go) Ruby interpreter packages for Windows, including Gtk support Just the Gtk library for Windows Just the Ruby/Gtk binding code Just the interpreter Utilities

Links