From: Erik Veenstra Date: 2005-08-11T01:36:09+09:00 Subject: Re: require and relative paths > require "./Classes/Printer" # My personal printer class > > Now if I want to run my program Ruby needs to find the > Printer.rb file in the Classes directory. But if the script > was run like this: > > $ cd ~ > $ ruby ~/rubydev/projects/texteditor/main.rb > > Then the current path will be ~ and Ruby won't find > ./Classes/Printer.rb > > How do I solve this problem? $: << File.dirname(File.expand_path(__FILE__)) require "Classes/Printer" Skip the "./" part. "." is already added to $: gegroet, Erik V. - http://www.erikveen.dds.nl/