如何初始化指南针记录器?

发布于 2024-10-28 19:06:44 字数 639 浏览 1 评论 0原文

我正在 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, ...]

哪里错了?

I'm trying compass in irb, this is my code:

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>

But there is a Logger class in compass/loggers.rb:

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

Where is wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天赋异禀 2024-11-04 19:06:44

尝试:

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

Try:

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={}>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文