如何初始化罗盘的记录器?

时间:2011-03-30 04:55:00

标签: ruby logging compass-sass

我在irb中尝试指南针,这是我的代码:

C:\Documents and Settings\test>irb

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'compass'
=> true
irb(main):003:0> logger = Compass::Logger.new()
NameError: uninitialized constant Compass::Logger
        from E:/Ruby187/lib/ruby/gems/1.8/gems/compass-0.10.6/lib/compass/versio
n.rb:51:in `const_missing'
        from (irb):3
irb(main):004:0>

Logger中有一个compass/loggers.rb类:

module Compass
    class Logger
        DEFAULT_ACTIONS = [:directory, :exists, ...]

哪里错了?

1 个答案:

答案 0 :(得分:2)

尝试:

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'compass/logger'   # <- note the path
=> true
irb(main):003:0> logger = Compass::Logger.new()
=> #<Compass::Logger:0x1011423f8 @actions=[:directory, :exists, :remove, :create, :overwrite, :compile, :error, :identical, :warning], @options={}>