From: vorlord2 Date: 2002-04-26T06:56:31+09:00 Subject: Re: Require vs. C++ include "Werner" wrote in message news:9a8e0212.0204240044.31b06b7e@posting.google.com... > Hi all, > > From the Ruby book (I have to admit I did not read the entire book), I > deduced that "require" in ruby does kind of the same thing as > "include" in c/c++. I then tried to use the Hello world class (in > Hello.rb) given with the samples within another source file(in the > same directory) by specifying "Require Hello" - The same way I saw it > done in library files. Upon trying to run my little program I got the > error that the file Hello could not by loaded(same directory???). > [snip] This should work exactly as you say. require by default looks in the current directory. If you are running script from a different directory it could be confused, i.e. (sorry I don't speak Windows very well, despite the fact I'm using it right now :) but the same principle applies): prompt> ruby somedir/mylittleprogram.rb ==error (with Hello.rb and mylittleprogram.rb both in somedir, and you in a different directory) Can you include a cut and paste of exact code and error message?