From: James Byrne Date: 2010-09-03T22:42:12+09:00 Subject: Re: 1.9 require problem Luis Lavena wrote: > On Sep 2, 5:32�pm, James Byrne wrote: >> >> require File.expand_path( >> File.dirname(__FILE__) + '/../lib/deploy/pg_access_setup') >> >> Then the problem is resolved. However, I do not understand why this is >> now necessary or what benefit accrues from introducing this change in >> behaviour between 1.8 and 1.9. > > $LOADED_FEATURES now tracks files with full paths to avoid requires > with File.dirname(__FILE__) load the same file twice. I see. Is there some reason that require does not issue an error that an absolute path was not provided instead of just reporting that it cannot find the file? The error message that is presently given simply reports the path used by require and does so in such a way that the necessity to provide an absolute path is not evident at all. The fact that an ls -l of the path reported together with the .rb extension will actually find the file required adds to the confusion. I understand the intent of the change. And I take it that require_relative was provided to maintain the old behaviour. However, this situation does seem to require a little more in the way of an explicit explanation of the probable cause of the errors which inevitably result from using 1.8 code with 1.9. -- Posted via http://www.ruby-forum.com/.