[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: rake + FileUtils == warining

Terry Poulin

8/29/2007 7:10:00 PM

Ronald Fischer wrote:
>> 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
>
> [snip]
>
>> Are you sure you don't want to require 'fileutils' rather than
>> 'FileUtils'?
>
> Indeed, I needed to write it as 'fileutils' and the error disappears.
>
> Now I wonder why I never got an error before in my application
> (I had always required 'FileUtils' before, but got an error only
> when I also started to use rake. It seems that Ruby had at least
> included *something* when I asked for FileUtils.....
>
> --
> Ronald Fischer <ronald.fischer@venyon.com>
> Phone: +49-89-452133-162
>
>
>

The file to be required is <install prefix>/lib/ruby/1.8/fileutils.rb which
implements the module FileUtils.

require 'filetuils' => correct, embeds fileutils.rb into current file
include FileUtils => correct, mixes in methods from FileUtils module into
current class/module.

At least, thats how I learned it.... I'm no Ruby professional so don't quote me.

TerryP.




--

Email and shopping with the feelgood factor!
55% of income to good causes. http://www.ip...