uninitialized constant Compass::Logger (NameError) #438

Closed
fbjork opened this Issue Jun 20, 2011 · 4 comments

Comments

Projects
None yet
5 participants

fbjork commented Jun 20, 2011

I tried adding the cache busting logic again, after the Pathname fix was committed (852f033)
and now I get the following error:

/Users/fredrik/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in const_missing': uninitialized constant Compass::Logger (NameError) from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/version.rb:56:inconst_missing'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/actions.rb:7:in logger' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/actions.rb:106:inlog_action'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/actions.rb:70:in remove' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/compiler.rb:78:inclean!'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/configuration/helpers.rb:141:in handle_configuration_change!' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/app_integration/rails.rb:61:ininitialize!'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/bundler/gems/compass-852f03316008/lib/compass/app_integration/rails/actionpack3/railtie.rb:43:in block in <class:Railtie>' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/initializable.rb:25:ininstance_exec'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/initializable.rb:25:in run' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/initializable.rb:50:inblock in run_initializers'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/initializable.rb:49:in each' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/initializable.rb:49:inrun_initializers'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/application.rb:134:in initialize!' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/application.rb:77:inmethod_missing'
from /Users/fredrik/Projects/lindenlab/my-secondlife/config/environment.rb:5:in <top (required)>' from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/application.rb:103:inrequire_environment!'
from /Users/fredrik/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.9/lib/rails/commands.rb:22:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'

This error is occurring to me when I switch between branches on my project. The only way to fix it is to run 'compass clean' on the command line.

The reason seems to be that branch changes trigger the compass configuration file to be touched and this sends compass into its handle_configuration_change! reload method. The error above is thrown because compass/logger doesn't seem to be 'required' in the lib/compass.rb file (initially when compass is loaded), nor is it required explicitely when the handle_configuration_change! is called, nor in the logger method directly. Perhaps the logger method is supposed to check and not log if logger is not loaded? It's required in 'compass/exec', however that's only called from the compass command line utility. As a hack, adding require 'compass/logger' into logger in actions.rb fixes this problem. I'm not sure if this is where it belongs.

sbc commented Jun 22, 2011

I was having this issue and running 'compass clean' worked for me. If this is a config issue and I need to require 'compass/logger' someplace, I would like to know the 'right' place to put it.

You shouldn't need to require it sbc. It seems to me that it needs a proper home in the gem. Otherwise, it will likely continue to happen if your compass configuration gets reloaded.

maxl0rd commented Jun 23, 2011

This is biting us too, right now. What's the consensus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment