资产编译因内存不足而失败

时间:2016-01-29 10:51:52

标签: ruby-on-rails asset-pipeline

我尝试在生产服务器上编译资源,但是当我使用编译运行rake任务时 - 进程太长而且出现内存错误。有跟踪

RAILS_ENV=production rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke bower:before_precompile (first_time)
** Execute bower:before_precompile
** Execute assets:precompile
rake aborted!
ExecJS::RuntimeError: FATAL ERROR: Evacuation Allocation failed - process out of memory
(execjs):1
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:219:in `exec_runtime'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:39:in `exec'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:21:in `eval'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:46:in `call'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/uglifier-2.7.1/lib/uglifier.rb:212:in `run_uglifyjs'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/uglifier-2.7.1/lib/uglifier.rb:179:in `compile'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.2/lib/sprockets/uglifier_compressor.rb:52:in `call'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.2/lib/sprockets/uglifier_compressor.rb:28:in `call'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/ubuntu/staging/releases/21/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'

我也尝试用config.assets.compile = false运行此操作,但我得到同样的错误,我该如何解决? 抱歉我的英文不好

0 个答案:

没有答案