Heroku运行rake资产:预编译失败? (不能转储匿名类)

时间:2014-10-17 01:57:10

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

以下是跟踪输出:这是什么:can't dump anonymous class的东西?不知道我还能尝试什么。我非常欢迎你的帮助。谢谢!!

heroku run rake assets:precompile --trace
Running `rake assets:precompile --trace` attached to terminal... up, run.1662
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
I, [2014-10-17T01:54:29.696549 #2]  INFO -- : Writing /app/public/assets/10code-7079b1d91d9d7c7a9a2338cea73f8a82.jpg
I, [2014-10-17T01:54:29.698443 #2]  INFO -- : Writing /app/public/assets/favicon-a74691afc8a111f00d70667670a61182.ico
I, [2014-10-17T01:54:37.258312 #2]  INFO -- : Writing /app/public/assets/application-16c68220ab8dd6d871a35138ee0901f0.js
Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/about.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/blog.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/contact.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 302a764321a9d0728b3e071c26d4a8996eeed852/footer.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 302a764321a9d0728b3e071c26d4a8996eeed852/navigation.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/portfolio.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/resources.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/resume.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

Warning. Error encountered while saving cache 377616f718d2970e646cd030c1890fad19bd5c36/welcome.css.scssc: can't dump anonymous class #<Class:0x007f7cefb6b200>

rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
  (in /app/app/assets/stylesheets/application.css)
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/sass_functions.rb:63:in `sprockets_context'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/sass_functions.rb:38:in `font_path'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:140:in `_perform'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/node.rb:50:in `perform'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:392:in `visit_return'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:36:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `block in with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:115:in `with_frame'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:8:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:248:in `block (3 levels) in perform_sass_fn'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:248:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:248:in `block (2 levels) in perform_sass_fn'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:247:in `catch'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:247:in `block in perform_sass_fn'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:84:in `perform_arguments'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:244:in `perform_sass_fn'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/funcall.rb:131:in `_perform'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/node.rb:50:in `perform'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/operation.rb:64:in `_perform'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/script/tree/node.rb:50:in `perform'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:458:in `visit_variable'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:36:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `block in with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:115:in `with_frame'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:315:in `block (2 levels) in visit_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:315:in `map'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:315:in `block in visit_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:88:in `block in with_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:115:in `with_frame'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:88:in `with_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:312:in `visit_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:36:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `block in with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:115:in `with_frame'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:315:in `block (2 levels) in visit_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:315:in `map'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:315:in `block in visit_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:88:in `block in with_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:115:in `with_frame'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:88:in `with_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:312:in `visit_import'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:36:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `block in with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:115:in `with_frame'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/stack.rb:79:in `with_base'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:158:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:52:in `map'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/base.rb:36:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:157:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/visitors/perform.rb:8:in `visit'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/root_node.rb:36:in `css_tree'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/tree/root_node.rb:20:in `render'
/app/vendor/bundle/ruby/2.1.0/gems/sass-3.4.5/lib/sass/engine.rb:268:in `render'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/sass_compressor.rb:24:in `evaluate'
/app/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/context.rb:197:in `block in evaluate'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/context.rb:194:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/context.rb:194:in `evaluate'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/bundled_asset.rb:25:in `initialize'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/base.rb:377:in `new'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/base.rb:377:in `build_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/index.rb:94:in `block in build_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/caching.rb:58:in `cache_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/index.rb:93:in `build_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/base.rb:287:in `find_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/index.rb:61:in `find_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/manifest.rb:211:in `block in find_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/manifest.rb:257:in `benchmark'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/manifest.rb:210:in `find_asset'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/manifest.rb:119:in `block in compile'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/manifest.rb:118:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/sprockets/manifest.rb:118:in `compile'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.0.beta1/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.2/lib/rake/sprocketstask.rb:146:in `with_logger'
/app/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.0.beta1/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/app/vendor/bundle/ruby/2.1.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/2.1.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile

1 个答案:

答案 0 :(得分:0)

之前发生过这种情况,最终导致无效的CSS在开发模式下没有在本地标记。如果你在本地编译它应该给你一些关于错误是什么的额外信息。

RAILS_ENV=production bin/rake assets:precompile

我最后一次遇到这个问题是因为结肠丢失了。