雖然在Ruby中使用log4r
,我寫了類似的配置文件中的以下內容:紅寶石:未初始化不斷log4r的:: DEBUG(NameError)問題
require 'rubygems'
require 'log4r'
require 'log4r/outputter/datefileoutputter'
SERVICE_LOG = {
:log_name => 'service',
:log_file => 'service.log',
:log_level => Log4r::DEBUG,
:message_pattern => "[%-5l %d] %C: %M",
:date_pattern => "%Y-%m-%d %H:%M:%S"
}
,當我跑它,它拋出了以下異常:
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Log4r::DEBUG (NameError)
它爲什麼這樣做?
非常酷,非常感謝你! – ywenbo 2011-04-27 07:15:12