guard / guard-compass

Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.
https://rubygems.org/gems/guard-compass
MIT License
60 stars 11 forks source link

ERROR: Rails.root is nil! #25

Open gastonmorixe opened 10 years ago

gastonmorixe commented 10 years ago

Guys, this gem is producing next error at run time.

My gem file is at the bottom.

/Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/util.rb:424:in `rails_root': ERROR: Rails.root is nil! (RuntimeError)
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin/rails.rb:11:in `default_options'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin/configuration.rb:33:in `options'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin/compiler.rb:38:in `initialize'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin.rb:63:in `new'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin.rb:63:in `compiler'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin.rb:120:in `options'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin/rails.rb:24:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.12/lib/sass/plugin.rb:127:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/compass-0.12.2/lib/compass/commands/watch_project.rb:5:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/compass-0.12.2/lib/compass/commands.rb:11:in `block in <top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/compass-0.12.2/lib/compass/commands.rb:10:in `each'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/compass-0.12.2/lib/compass/commands.rb:10:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/bundler/gems/guard-compass-d066c9a96fd8/lib/guard/compass_helper.rb:2:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/bundler/gems/guard-compass-d066c9a96fd8/lib/guard/compass.rb:5:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `rescue in block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /Users/gaston/Sites/cointrust/config/application.rb:11:in `<top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:74:in `require'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:74:in `block in <top (required)>'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:71:in `tap'
    from /Users/gaston/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:71:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

    gem 'haml', '~> 4.0'
    gem 'sass', '3.2.12'
    gem 'sass-rails', '~> 4.0.0' #4.0.1, 4.0.0, 3.2.6
    gem 'jquery-rails'
    gem 'bootstrap-sass', '~> 3.0.2.0', github: 'thomas-mcdonald/bootstrap-sass', branch: 'master' 
    gem 'compass', '~> 0.12.2'
    gem 'compass-rails', '2.0.alpha.0'

    gem 'animation'
    gem 'modernizr-rails'
    gem 'coffee-rails' #, '~> 4.0'
    gem 'uglifier', '>= 1.0.3'
    gem 'yui-compressor'

group :development do
    # Guard
    gem 'guard', github: 'guard'
    gem 'guard-compass', github: 'guard/guard-compass'
    gem 'guard-shell'
    gem 'guard-livereload', require: false

    gem 'awesome_print' 
    gem 'binding_of_caller'
    gem 'better_errors'
    gem 'rspec-rails'
    gem 'meta_request'
    gem 'debugger'  
    # gem 'rspec-console'
    # gem 'pry-rails'
    # gem 'irbtools', :require => false
end 
gastonmorixe commented 10 years ago

Ok, I think I solved it by using require:false

gem 'guard-compass', github: 'guard/guard-compass', require: false