0

Here is my application.scss file:

@import "variables";
@import "bootstrap-sprockets";
@import "bootstrap-overrides";
@import "bootstrap";
@import "fancybox/jquery.fancybox";
@import "fancybox/jquery.fancybox-thumbs";
@import "fancybox/jquery.fancybox-buttons";
@import "font-awesome";
@import "theme";
@import "magnific-popup";
@import "jquery.gritter";
@import "summernote";
@import "style";
@import "media";

I've tried naming the "variables" file _variables.scss and variables.scss but neither works, because when I precompile, it seems like everything is precompiled in alphabetical order. So as soon as media.scss has begun precompiling, I get this error:

Sass::SyntaxError: Undefined variable: "$white".
/Users/Trevor/Work/SplitRock/app/assets/stylesheets/_media.scss:3
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/script/tree/variable.rb:49:in `_perform'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/script/tree/node.rb:50:in `perform'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:394:in `visit_prop'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:79:in `block in with_base'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:115:in `with_frame'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:79:in `with_base'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:430:in `block (2 levels) in visit_rule'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:430:in `map'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:430:in `block in visit_rule'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:428:in `visit_rule'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:79:in `block in with_base'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:115:in `with_frame'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:79:in `with_base'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `map'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:512:in `visit_media'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:79:in `block in with_base'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:115:in `with_frame'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/stack.rb:79:in `with_base'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `map'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:157:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:8:in `visit'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/root_node.rb:36:in `css_tree'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/tree/root_node.rb:20:in `render'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-3.4.13/lib/sass/engine.rb:268:in `render'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sass-rails-5.0.3/lib/sass/rails/template.rb:47:in `evaluate'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/legacy_tilt_processor.rb:25:in `call'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:103:in `load_asset_by_uri'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:40:in `block in load'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:171:in `fetch_asset_from_dependency_cache'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:33:in `load'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/cached_environment.rb:47:in `yield'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/cached_environment.rb:47:in `load'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/bundle.rb:23:in `block in call'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/utils.rb:183:in `dfs'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/bundle.rb:24:in `call'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:103:in `load_asset_by_uri'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:40:in `block in load'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:171:in `fetch_asset_from_dependency_cache'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/loader.rb:33:in `load'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/cached_environment.rb:47:in `yield'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/cached_environment.rb:47:in `load'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/base.rb:63:in `find_asset'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/base.rb:70:in `find_all_linked_assets'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/manifest.rb:138:in `block in find'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/path_utils.rb:204:in `each'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/path_utils.rb:204:in `stat_directory'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/path_utils.rb:222:in `stat_tree'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/legacy.rb:105:in `each'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/legacy.rb:104:in `each'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/legacy.rb:104:in `logical_paths'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/manifest.rb:136:in `find'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/sprockets/manifest.rb:162:in `compile'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-3.0.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/Users/Trevor/.rvm/gems/ruby-2.2.2/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
trevorhinesley
  • 845
  • 1
  • 10
  • 36
  • Possible duplicate: http://stackoverflow.com/questions/17976140/false-positive-undefined-variable-error-when-compiling-scss – cimmanon Apr 23 '15 at 21:00

1 Answers1

0

Turns out, I had added ALL files to precompile basically, which messed up the precompilation order. It even tried to precompile the bootstrap-sass gem when it didn't need to. Problem solved by removing a bunch of the wildcards.

Here was the problem line in assets.rb:

Rails.application.config.assets.precompile += %w( gritter/* *.js *.css *.png *.gif *.jpeg *.jpg )

I changed that to:

Rails.application.config.assets.precompile += %w( gritter/* fancybox/* welcome.js )

trevorhinesley
  • 845
  • 1
  • 10
  • 36