> From file a, I require a file b (located in a directory under the > current one), which requires a file c (b and c are located in the same > directory). > For that second require (b requires c), I get a loadError. > If I run b directly (which requires c); no error. > When I run a, I again get the loadError that says b can't load c. > I can require c from a, c form b, but not c from b from a. > > ? I still think the best "trick" for this problem is to alter the load path as David Alan Black has suggested. In my RubyGems project I have a lib directory where I keep all my main source files. In the same base directory that lib is in I have a tests directory where I keep all my unit tests. At the top of each unit test file, before I require any of my rubygems files, I have the following code: $LOAD_PATH[0, 0] = '../lib'. This does the same thing as $:.unshift '../lib', just with a different syntax. Now whenever the unit tests require a file (and when that file requires something else), they all load fine. This works great and allows all my core source files to have normal paths for their requires (so there is no need to change anything when they are installed globally.) Ryan Leavengood