From: mortee Date: 2007-10-01T22:21:45+09:00 Subject: Re: gem_original_require no such file to load Thomas Wieczorek wrote: > Hi! > > 2007/10/1, Andrea Maschio : > >> Have you got any idea for this behaviour? >> > > Yes, I think that the IDEs add your project path to the $LOAD_PATH > variable while the ruby interpreter(used by SciTe) and irb just add > "."(the current folder) to the load path. You can use the -I > parametre on the command line to add your project path to > $LOAD_PATH The problem is actually that while you invoke the scripts from their own directory, the IDE sets the current directory to the project root. As I noticed, e.g. "require" doesn't use the script's own directory while searching for libs (even when specified by relative paths), only those listed in the load path. This path usually happens to nclude ".", so if your current working dir is the script's own, you're OK, but the IDE sets it otherwise. As I've seen in a couple of examples, it seems to be a common practice to use require File.dirname(__FILE__) + "/../relative/path" instead of require "../relative/path" The former makes sure that the lib will be searched for relative to your current script file. mortee