2014-09-21 67 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選項解決了問題,結果幾乎相同。