当我运行:
rake assets:precompile RAILS_ENV=production --trace
我得到以下异常:
rake aborted!
Sass::SyntaxError: Invalid CSS after " */": expected "}", was ""
(sass):19419
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:1179:in `expected'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:1115:in `expected'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:1110:in `tok!'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:656:in `block'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:647:in `ruleset'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:673:in `block_child'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:666:in `block_contents'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:123:in `stylesheet'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/scss/parser.rb:39:in `parse'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/engine.rb:403:in `_to_tree'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sass-3.4.21/lib/sass/engine.rb:278:in `render'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/sass_compressor.rb:48:in `call'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/sass_compressor.rb:28:in `call'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/loader.rb:60:in `block in load'
/Users/fernando/.rvm/gems/ruby-2.3.0/gems/sprockets-3.5.2/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
....
我怎样才能找出导致该异常的文件吗? 是否有青菜护栏的选项来调试这个问题?
注:此应用程序的CSS / JavaScript是在开发模式下工作。 此异常仅在生产预编译的资产或运行RSpec的功能测试时发生的时候。
注2: 启用config.css_compressor此问题时才会发生。 如果我禁用它,资产预编译没有问题。