【问题标题】:How to initialize a logger of compass?如何初始化罗盘记录器?
【发布时间】:2011-07-26 04:39:04
【问题描述】:

我正在 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>

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

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

哪里错了?

【问题讨论】:

    标签: ruby logging compass-sass


    【解决方案1】:

    试试:

    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={}>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-11-08
      • 1970-01-01
      • 1970-01-01
      • 2011-01-08
      • 1970-01-01
      • 2021-05-31
      • 1970-01-01
      相关资源
      最近更新 更多