在heroku生产站点上编译资产时出错

时间:2016-10-05 20:45:31

标签: ruby-on-rails ruby-on-rails-4 heroku asset-pipeline assets

我一直在开发一个突然停止编译/大多数/资产的网站。我发现语法错误(我在页面顶部缺少一个分号)并修复它,但是heroku生产站点仍在检测它。资产无法加载,运行heroku run rake assets:precompile

时出现此错误
rake aborted!
Sass::SyntaxError: Invalid CSS after "}": expected "}", was ""
  (in /app/app/assets/stylesheets/application.css)
(sass):505
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:1189:in `expected'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:1125:in `expected'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:1120:in `tok!'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:658:in `block'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:409:in `media_directive'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:222:in `special_directive'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:197:in `directive'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:675:in `block_child'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:668:in `block_contents'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:125:in `stylesheet'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/scss/parser.rb:41:in `parse'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/engine.rb:406:in `_to_tree'
/app/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/engine.rb:281:in `render'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/sass_compressor.rb:24:in `evaluate'
/app/vendor/bundle/ruby/2.2.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/context.rb:197:in `block in evaluate'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/context.rb:194:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/context.rb:194:in `evaluate'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/bundled_asset.rb:25:in `initialize'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:in `new'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/base.rb:377:in `build_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/index.rb:94:in `block in build_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/caching.rb:58:in `cache_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/index.rb:93:in `build_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/base.rb:287:in `find_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/index.rb:61:in `find_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:211:in `block in find_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:257:in `benchmark'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:210:in `find_asset'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:119:in `block in compile'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/sprockets/manifest.rb:118:in `compile'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-2.12.4/lib/rake/sprocketstask.rb:146:in `with_logger'
/app/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace

有人有这个问题吗?我尝试在production.rb中发表评论config.assets:compile = true并运行heroku run rake assets:clobber,但问题仍然存在......

0 个答案:

没有答案