From scott at zenplex.com Wed Jun 4 19:22:31 2008 From: scott at zenplex.com (Scott Comboni) Date: Wed, 4 Jun 2008 19:22:31 -0400 Subject: [ruby-dbi-users] require 'Date' and require 'dbi' issues. Message-ID: Hello has anyone seen this. equire 'dbi' => true >> require 'Date' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:238: warning: already initialized constant MONTHNAMES /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:243: warning: already initialized constant DAYNAMES /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:247: warning: already initialized constant ABBR_MONTHNAMES /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:250: warning: already initialized constant ABBR_DAYNAMES /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:302: warning: already initialized constant ITALY /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:306: warning: already initialized constant ENGLAND /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:310: warning: already initialized constant JULIAN /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:314: warning: already initialized constant GREGORIAN /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/Date.rb:316: warning: already initialized constant UNIXEPOCH => true Seems there are some conflicts. Any suggestions? I was thinking I could load up ActiveSupport and use those date functions. thanks sc From databaseofgrace.5.pistos at geoshell.com Wed Jun 4 21:08:58 2008 From: databaseofgrace.5.pistos at geoshell.com (databaseofgrace.5.pistos at geoshell.com) Date: Wed, 4 Jun 2008 21:08:58 -0400 Subject: [ruby-dbi-users] require 'Date' and require 'dbi' issues. In-Reply-To: References: Message-ID: <6c9d9ef0806041808rdef9252mb7acb14d6344960@mail.gmail.com> On 04/06/2008, Scott Comboni - scott at zenplex.com wrote: > Hello has anyone seen this. > > equire 'dbi' > => true > >> require 'Date' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/Date.rb:238: > warning: already initialized constant MONTHNAMES > > Seems there are some conflicts. Any suggestions? I was thinking I could > load up ActiveSupport and use those date functions. % irb irb(main):001:0> require 'dbi' => true irb(main):002:0> require 'date' => false irb(main):003:0> require 'Date' LoadError: no such file to load -- Date from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from (irb):3 Looks like it's some OSX-ism. No problems here on Gentoo Linux. Nevertheless, they're just warnings, so not that harmful... if you're desperate, you can use code like this [in Date.rb] to prevent redefinitions of constants: if not defined?( SOME_CONSTANT ) # Safe to define... SOME_CONSTANT = value end -- Pistos http://blog.purepistos.net From erik at hollensbe.org Wed Jun 4 21:50:51 2008 From: erik at hollensbe.org (Erik Hollensbe) Date: Wed, 4 Jun 2008 18:50:51 -0700 Subject: [ruby-dbi-users] require 'Date' and require 'dbi' issues. In-Reply-To: References: Message-ID: <200806041850.52270.erik@hollensbe.org> On Wednesday 04 June 2008 16:22:31 Scott Comboni wrote: > Seems there are some conflicts. Any suggestions? I was thinking I > could load up ActiveSupport and use those date functions. Interesting... This is arguably a bug in ruby. See, it's requiring the same date library twice, but the difference in capitalization in the require causes an error on OS X (which is case-insensitive, similar to windows). In any case, other than the warnings I'd be surprised if it was anything other than harmless. I'll put in a fix in a day or so and release it, and talk to some ruby devs about if this is worth reporting upstream or not. Thanks for the report. -Erik From scott at zenplex.com Thu Jun 5 08:29:22 2008 From: scott at zenplex.com (Scott Comboni) Date: Thu, 5 Jun 2008 08:29:22 -0400 Subject: [ruby-dbi-users] require 'Date' and require 'dbi' issues. In-Reply-To: <200806041850.52270.erik@hollensbe.org> References: <200806041850.52270.erik@hollensbe.org> Message-ID: Thanks Erik, I can test on my linux box in the meantime I have a workaround and dbi is working great.. Thanks so much. Sc- On Jun 4, 2008, at 9:50 PM, Erik Hollensbe wrote: > On Wednesday 04 June 2008 16:22:31 Scott Comboni wrote: >> Seems there are some conflicts. Any suggestions? I was thinking I >> could load up ActiveSupport and use those date functions. > > Interesting... This is arguably a bug in ruby. > > See, it's requiring the same date library twice, but the difference in > capitalization in the require causes an error on OS X (which is > case-insensitive, similar to windows). > > In any case, other than the warnings I'd be surprised if it was > anything other > than harmless. > > I'll put in a fix in a day or so and release it, and talk to some > ruby devs > about if this is worth reporting upstream or not. > > Thanks for the report. > > -Erik > From erik at hollensbe.org Fri Jun 6 09:44:57 2008 From: erik at hollensbe.org (Erik Hollensbe) Date: Fri, 6 Jun 2008 06:44:57 -0700 Subject: [ruby-dbi-users] require 'Date' and require 'dbi' issues. In-Reply-To: References: Message-ID: <200806060644.57577.erik@hollensbe.org> On Wednesday 04 June 2008 16:22:31 Scott Comboni wrote: > Hello has anyone seen this. > > equire 'dbi' > => true > > >> require 'Date' Looking at this again, it seems this has nothing to do with Ruby/DBI, however it is probably worth reporting to the Ruby core team. Scott, can you take care of that or would you prefer I do? -Erik