Path for classes called with require

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?


After reading 7.6 in “The Ruby P.ming 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs