From: LAMBEAU Bernard Date: 2009-01-05T18:55:45+09:00 Subject: Re: How can I prevent require duplicate files Well, we know that ruby 1.8.x doesn't ensure unique loading with that kind of require ... There's another hack below, that should be consolidated however, module Kernel alias_method :old_require, :require def require(path) old_require(File.expand_path(path)) end end Otherwise, you can use 'require File.expand_path('oldpath')' each time, but that's even more ugly. blambeau On Mon, Jan 5, 2009 at 10:32 AM, Brian Candler wrote: > LAMBEAU Bernard wrote: >> There must be a mistake, below is the test I've made. No warning at >> all, even with warning level set to 2 > > Now try: > > require 'test1' > require './test1' > require '/home/someuser/test1' > -- > Posted via http://www.ruby-forum.com/. > >