Rails资产管道“无法分配内存-Node.js" [英] rails assets pipeline "Cannot allocate memory - nodejs"
问题描述
我们刚刚从Rails 3.0.7升级到Rails 3.2.5,并在暂存服务器上动态使用Assets-pipeline编译,但是有时我们会遇到这种异常!
we've just upgraded to Rails 3.2.5 from Rails 3.0.7 and using the assets-pipeline compilation on the fly for the staging server, but some times we face this exception !
Showing /var/rails/appname/app/views/common/_my_partial.html.haml where line # raised:
Cannot allocate memory - nodejs /tmp/execjs20120613-17090-thoc8f.js 2>&1
Extracted source (around line #):
Trace of template inclusion: app/views/layouts/application.html.haml
例如,尽管在咖啡脚本或图像文件夹中没有花哨的工作或巨大的内存分配!
Although nothing fancy or huge memory allocations is done in the coffeescripts or in the images folder for example !
谢谢...
推荐答案
只需花费三分钟(如果您快速键入,则可能是两分钟)来向服务器添加交换文件.
It's simple to spend the three minutes (maybe two if you type fast) to add a swap file to your server.
如果您正在运行Ubuntu(不确定该功能在其他Linux操作系统上的运行情况如何),只需按照DigitalOcean的本教程进行操作即可:
If you're running Ubuntu (not sure how well this works for other Linux flavors), just follow this tutorial from DigitalOcean:
https://www. digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
Voila!
这篇关于Rails资产管道“无法分配内存-Node.js"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!