From: jean.boussier@... Date: 2015-07-28T02:17:01+00:00 Subject: [ruby-core:70140] [Ruby trunk - Bug #9244] unexpected behaviour of 'require' when $LOAD_PATH gets changed Issue #9244 has been updated by Jean Boussier. ruby -v changed from 1.9.3p484, 2.0.0p353, 2.1.2 to 1.9.3p484, 2.0.0p353, 2.1.2 2.1.6p336 2.2.1p85 ~~~ $ ruby -v ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-darwin14.0] $ cat test.rb $LOAD_PATH.unshift File.join(Dir.pwd, 'a') require 'test.rb' $LOAD_PATH.unshift File.join(Dir.pwd, 'b') require 'test.rb' $ ruby test.rb a ~~~ It's still a problem in 2.1.6, and 2.2.1 as well ---------------------------------------- Bug #9244: unexpected behaviour of 'require' when $LOAD_PATH gets changed https://bugs.ruby-lang.org/issues/9244#change-53572 * Author: Sylvain Joyeux * Status: Feedback * Priority: Normal * Assignee: * ruby -v: 1.9.3p484, 2.0.0p353, 2.1.2 2.1.6p336 2.2.1p85 * Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN ---------------------------------------- For the purpose of reproducing the error, let's assume that I have two folders ```a``` and ```b``` which both contain a file ```test.rb``` In the following script, ```b/test.rb``` will NOT get loaded: ``` $LOAD_PATH.unshift File.join(Dir.pwd, 'a') require 'test.rb' $LOAD_PATH.unshift File.join(Dir.pwd, 'b') require 'test.rb' ``` I would have expected this behaviour before, when required files were not registered through their absolute paths in $LOADED_FEATURES. Right now, I find it confusing. -- https://bugs.ruby-lang.org/