[ruby-dbi-users] require 'Date' and require 'dbi' issues.

databaseofgrace.5.pistos at geoshell.com databaseofgrace.5.pistos at geoshell.com
Wed Jun 4 21:08:58 EDT 2008


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


More information about the ruby-dbi-users mailing list