From: Alex Young Date: 2007-08-29T22:02:15+09:00 Subject: Re: rake + FileUtils == warining Ronald Fischer wrote: > When I require both rake and FileUtils, i.e. > > require 'rake' # for String#ext > require 'FileUtils' > > I get the following warnings: > > c:/ruby186/lib/ruby/1.8/FileUtils.rb:93: warning: already initialized > constant OPT_TABLE > c:/ruby186/lib/ruby/1.8/FileUtils.rb:1163: warning: already initialized > constant S_IF_DOOR > c:/ruby186/lib/ruby/1.8/FileUtils.rb:1513: warning: already initialized > constant METHODS > > Who is to blame? FileUtils, rake, or me (because I'm not supposed to > require both)? > > What can I do to avoid the warnings? Please do not suggest simply > omitting FileUtils > when I'm using rake (I guess the warning results from rake also > including FileUtils). > I don't require them *directly* in the same module. Instead I have > > require 'rake' > require 'SomeOtherModule' > > in one file, and SomeOtherModule.rb happens to use FileUtils, and this > causes the > warnings in the end. > > Ronald Are you sure you don't want to require 'fileutils' rather than 'FileUtils'? The latter gives me errors while the former does not. Actually, it looks to me like rake (or possibly rubygems) requires fileutils anyway... -- Alex