我在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, ...]
哪里错了?
答案 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={}>