I''ve been experimenting with code to try to duplicate this problem...
here''s another problem I''ve found that may have the same root
cause:
I recently added some activerecord code to a stand-alone application that
uses Log4R. I''m getting some weird conflicts.
The code below demonstrates one of the problems I see... if you remove the
line : "require_gem ''activerecord''" the code
executes fine. If you have it
in the code you will get the following error:
C:/ruby/lib/ruby/site_ruby/1.8/log4r/logger.rb:109:in `outputters='':
undefined method `clear'' for nil:NilClass (NoMethodError)
from C:/dev/src/scratch/scratch.rb:11
Here is the code:
require ''log4r''
include Log4r
require "rubygems"
require_gem "activerecord"
#require "database/active_storage"
# create a logger named ''mylog'' that logs to stdout
mylog = Logger.new ''mylog''
puts mylog.inspect
mylog.outputters = Outputter.stdout
# Now we can log.
def do_log(log)
log.debug "This is a message with level DEBUG"
log.info "This is a message with level INFO"
log.warn "This is a message with level WARN"
log.error "This is a message with level ERROR"
log.fatal "This is a message with level FATAL"
end
do_log(mylog)
mylog.level = ERROR
mylog.error "BLAHBLAH"
Any insight on what''s going on here?
phil
-----Original Message-----
From: Phil Swenson
[mailto:phil-XITSOACK58NFw/DY4jzso32qnSAIaJbt@public.gmane.org]
Sent: Monday, December 19, 2005 4:50 PM
To: ''rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org''
Subject: RE: [Rails] Re: tough activerecord problem
Sure thing:
test:
[exec] Result: 1
[echo] Test Output:
[echo] Database Connection established
[echo] Loaded suite
C:/dev/build/app/IntradayCruncher/test/ts_intraday_cruncher
[echo] Started
[echo] ...EE
[echo] Finished in 0.75 seconds.
[echo]
[echo] 1) Error:
[echo] test_pipeline_cruncher(IntradayCruncher::TestPipelineCruncher):
[echo] NameError: uninitialized constant INFO
[echo]
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/depend
encies.rb:200:in `const_miss
ing''
[echo]
C:\dev\build\app\IntradayCruncher\lib\common/logging.rb:40:in
`init_loggers''
[echo]
C:\dev\build\app\IntradayCruncher\test/tc_pipeline_cruncher.rb:34:in
`test_pipeline_cruncher''
[echo]
[echo] 2) Error:
[echo] test_time_cruncher(IntradayCruncher::TestTimeCruncher):
[echo] NameError: uninitialized constant INFO
[echo]
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/depend
encies.rb:195:in `const_miss
ing''
[echo]
C:\dev\build\app\IntradayCruncher\lib\common/logging.rb:40:in
`init_loggers''
[echo]
C:\dev\build\app\IntradayCruncher\test/tc_time_cruncher.rb:31:in
`test_time_cruncher''
[echo]
[echo] 5 tests, 3 assertions, 0 failures, 2 errors
-----Original Message-----
From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On
Behalf Of Mitchell Hashimoto
Sent: Monday, December 19, 2005 3:53 PM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails] Re: tough activerecord problem
Phil Swenson wrote:> Any thoughts?
Can you possibly give us a larger backtrace? Instead of just in
dependencies.rb
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails