2014-09-21 68 views
0

什么似乎是完美的我在本地运行,并在100MB的内存,似乎在Heroku的服务器的测功机不可能完成的任务......耙资产:预编译与在Heroku内存链轮超过

我怎样才能找出是什么导致这个内存在任务本身中崩溃?

$heroku run bundle exec rake assets:precompile -a myapp    

Running `rake assets:precompile` attached to terminal... 2014-09-21T22:35:19.129047+00:00 heroku[api]: Starting process with command `bundle exec rake assets:precompile` by [email protected] 
up, run.3387 
2014-09-21T22:35:38.348540+00:00 heroku[run.3387]: Awaiting client 
2014-09-21T22:35:38.410272+00:00 heroku[run.3387]: Starting process with command `bundle exec rake assets:precompile` 
2014-09-21T22:35:38.489421+00:00 heroku[run.3387]: State changed from starting to up 
RSpec is not part of this bundle, skip specs. 
Warning. Error encountered while saving cache /app/.sass-cache/cce550dafbc86189868cd4c9d7eaf6d5c3eab036/application.sassc: can't dump anonymous class #<Class:0x007f009904f9e8> 
2014-09-21T22:36:04.665412+00:00 heroku[run.3387]: Process running mem=687M(134.3%) 
2014-09-21T22:36:04.665737+00:00 heroku[run.3387]: Error R14 (Memory quota exceeded) 
2014-09-21T22:36:24.743579+00:00 heroku[run.3387]: Process running mem=689M(134.7%) 
2014-09-21T22:36:24.743579+00:00 heroku[run.3387]: Error R14 (Memory quota exceeded) 
2014-09-21T22:36:44.586205+00:00 heroku[run.3387]: Process running mem=691M(135.0%) 
2014-09-21T22:36:44.586205+00:00 heroku[run.3387]: Error R14 (Memory quota exceeded) 

“ls -la”似乎列出了成功部署时编译的正确资产。但是,当应用程序启动时,Sprockets无法找到public/assets/*中包含的文件,它可能是权限错误吗?

回答

0

SOLUTION:

从Heroku的支持:

您好, 它看起来像资产编译构建蛞蝓当没有成功完成:

Running: rake assets:precompile 
    RSpec is not part of this bundle, skip specs. 
    Warning. Error encountered while saving cache /tmp/build_c2c58e6a-e133-4fa2-8ad1-29d0e1a3f106/.sass-cache/b8f882ea75af7a30f0356eee89e2cb5703efe81b/application.sassc: can't dump anonymous class #<Class:0x007fd865e70118> 
    Asset precompilation completed (20.48s) 

你可能知道很多更关于你的应用程序的资产管道比我做的更多。这个构建看起来相当大,它是在推测一个我猜测是'yui-compressor'的JVM吗?您可能会考虑使用Java离开宝石。我们必须拖动JVM,并占用大量磁盘空间。这可能是这里发生的事情。如果没有JVM,您将拥有更多可用于资产编译的磁盘。


使用:scss as spss中的css_compressor选项解决了问题,结果几乎相同。