Forum: FXRuby path for classes called with require

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
53e36aa2a81c817ff4649aade7a42860?d=identicon&s=25 Jessica T. (jesst)
on 2010-01-22 01:28
I'm working through the 'picturebook.rb' example in "FXRuby Create Lean
and Mean GUIs with Ruby" and got stuck embarrassingly early in the book.
I'm good up to the point that a blank window pops up (p 28).  When I
proceed to add the other classes (p 30), errors result.  The program
runs fine as shown, but when the commented lines are uncommented an
error message is shown (below).

Code that replicates p 30 with four lines commented out:

require 'fox16'

include Fox

#require 'photo'
#require 'photo_view'

class PictureBook < FXMainWindow
    def initialize(app)
        super(app, "Picture Book", :width => 600, :height => 400)
        #photo ="bridge damage10.jpg")
        #photo_view =, photo)

    def create

if __FILE__ == $0 do |app|

Error message:

'gem_original_require': no such file to load -- photo (LoadError)

from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31: in

from C:/Ruby/myscripts/picturebook/picturebook.rb:5

It seems like the fix would be to path the files so FXRuby can find
them, but I don't know what path that would be?

53e36aa2a81c817ff4649aade7a42860?d=identicon&s=25 Jessica T. (jesst)
on 2010-01-27 18:43
After reading 7.6 in "The Ruby Programming Language" I know what path is
searched first.  I was running the program with an absolute path, so the
other files were not found.  Now I'm getting a different error:

C:/Ruby/lib/ruby/site_ruby/1.8/fox16/kwargs.rb:1193:in 'old_initialize':
 wrong argument type Photo (expected Data) (TypeError)

The error output continues.
This topic is locked and can not be replied to.