From: Kaspar Schiess Date: 2009-12-01T17:54:24+09:00 Subject: Re: Detect the path used to require a file? > I'm having a problem in which a file is being required twice, using > slightly different paths, and I want to track down where this is > happening. Is there a way I can print out the path used to require a > given file? In most Ruby implementations the __FILE__ constant will be different depending on how the file was loaded. Notably, it will reflect the path used to load the file. == test.rb == puts __FILE__ ============= > ruby -r test.rb -e '' ./test.rb > ruby -r /home/user/temp/test.rb /home/user/temp/test.rb regards, kaspar