>>>>> "D" == David Heinemeier Hansson <david / loudthinking.com> writes:

D> log4r.rbx:

 ruby is trying to load *twice* the same module 'singleton.rb' : it do this
 because it don't have the same path, or name, or version, for singleton.rb

svg% cat b.rb
#!/usr/bin/ruby
require 'singleton'
class Something
   include Singleton
end
require 'log4r'
svg%
 
svg% b.rb
svg%

 Now 

svg% cat b.rb
#!/usr/bin/ruby
require '/usr/local/lib/ruby/1.8/singleton.rb'
class Something
   include Singleton
end
require 'log4r'
svg% 

svg% b.rb
/usr/local/lib/ruby/1.8/singleton.rb:119: warning: already initialized constant FirstInstanceCall
/usr/local/lib/ruby/1.8/singleton.rb:161:in `undef_method': undefined method `extend_object' for `Singleton' (NameError)
        from /usr/local/lib/ruby/1.8/singleton.rb:161
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/repository.rb:4:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/repository.rb:4
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/outputterfactory.rb:5:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/outputterfactory.rb:5
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:10:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:10
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/iooutputter.rb:2:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/iooutputter.rb:2
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/fileoutputter.rb:4:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/log4r/outputter/fileoutputter.rb:4
        from /usr/local/lib/ruby/site_ruby/1.8/log4r.rb:8:in `require'
        from /usr/local/lib/ruby/site_ruby/1.8/log4r.rb:8
        from ./b.rb:6:in `require'
        from ./b.rb:6
svg% 


 For ruby 

   require '/usr/local/lib/ruby/1.8/singleton.rb'

 is different (it think that it's another module) 

   require 'singleton' # which is in repository.rb

 This is why it give an error

 Another reason is that you mix
   * ruby 1.8.0
   * mod_ruby built with ruby 1.6.8


Guy Decoux