Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Mixins conflict? FileUtils and mini_exiftool

Reply
Thread Tools

Mixins conflict? FileUtils and mini_exiftool

 
 
12 34
Guest
Posts: n/a
 
      07-06-2007
Not sure if Mixins is the right word. But I have

require 'rubygems' # # Needed by rbosa, mini_exiftool, appscript, --at
least in my installation
require 'FileUtils'
require 'mini_exiftool' # a wrapper for the Perl ExifTool
# I have a couple of others in my script, but these two are the ones
conflicting

FileUtils and mini_exiftool are apparently both trying to use the same
contant. Here's the error I get using TextMate:

/usr/local/lib/ruby/1.8/fileutils.rb:93: warning: already initialized
constant OPT_TABLE
/usr/local/lib/ruby/1.8/fileutils.rb:1163: warning: already initialized
constant S_IF_DOOR
/usr/local/lib/ruby/1.8/fileutils.rb:1513: warning: already initialized
constant METHODS

Script runs and is doing what I want AFAIK, but there may be some glitch
that I haven't detected yet.

Thanks

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Alex Young
Guest
Posts: n/a
 
      07-06-2007
12 34 wrote:
> Not sure if Mixins is the right word. But I have
>
> require 'rubygems' # # Needed by rbosa, mini_exiftool, appscript, --at
> least in my installation
> require 'FileUtils'
> require 'mini_exiftool' # a wrapper for the Perl ExifTool
> # I have a couple of others in my script, but these two are the ones
> conflicting
>
> FileUtils and mini_exiftool are apparently both trying to use the same
> contant. Here's the error I get using TextMate:
>
> /usr/local/lib/ruby/1.8/fileutils.rb:93: warning: already initialized
> constant OPT_TABLE
> /usr/local/lib/ruby/1.8/fileutils.rb:1163: warning: already initialized
> constant S_IF_DOOR
> /usr/local/lib/ruby/1.8/fileutils.rb:1513: warning: already initialized
> constant METHODS
>
> Script runs and is doing what I want AFAIK, but there may be some glitch
> that I haven't detected yet.

Your fileutils require is "require 'FileUtils'", while mini_exiftools
probably requires is as "require 'fileutils'". Because of the case
difference, require thinks it hasn't seen fileutils before when
mini_exiftool require's it, and tries to load it again. At least,
that's my guess. Try changing your "require 'FileUtils'" to "require
'fileutils'" and see if the warnings go away.

--
Alex

 
Reply With Quote
 
 
 
 
12 34
Guest
Posts: n/a
 
      07-07-2007
Alex Young wrote:
> 12 34 wrote:
>> contant. Here's the error I get using TextMate:
>>
>>

> Your fileutils require is "require 'FileUtils'", while mini_exiftools
> probably requires is as "require 'fileutils'". Because of the case
> difference, require thinks it hasn't seen fileutils before when
> mini_exiftool require's it, and tries to load it again. At least,
> that's my guess. Try changing your "require 'FileUtils'" to "require
> 'fileutils'" and see if the warnings go away.

Good guess. Thanks.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mixins and overloading Daniel C++ 1 07-15-2011 12:07 PM
mixins and new style classes mk Python 1 02-17-2010 08:31 PM
A little COM, mixins and Ruby go a long way ... John Lam Ruby 1 04-27-2005 02:49 AM
mixins and extend (was: Attempted roadmap of future instance variables....) T. Onoma Ruby 5 12-06-2003 04:27 PM
Design help? Mixins and duck-typing Dave Fayram Ruby 0 08-27-2003 05:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57