From: Tom Wardrop Date: 2010-10-07T14:19:53+09:00 Subject: "Load" Works, But "Require" Doesn't? Can someone please explain what's going on here. No matter what I try, every time I call require() with a relative path, it comes back with "LoadError: no such file to load". Yet, at the same time, load() works perfectly fine with the exact same relative path. Require() doesn't seem to have a problem with absolute paths, in fact this bit of code works flawlessly... require File.expand_path('subfolder/file.rb') ...but the follow code fails with the LoadError mentioned earlier... require 'subfolder/file.rb' I've got RubyGem's installed, so I thought maybe it's override of the require() method was causing havoc, so I tried gem_original_require() with the exact same result, LoadError. I'm getting this problem from both the "irb" and the "ruby" executables. Checking Dir.pwd reveals that indeed, the current directory is as expected/intended. Can someone explain to me why require() isn't working with relative paths? I'm completely baffled and don't know where to go from here. Cheers -- Posted via http://www.ruby-forum.com/.