2016-11-07 48 views
0

我想編譯我的JavaScript資產。我已經包含了幾乎2MB大小的plotly.js文件。還包括了angualr2.dev.js文件,它的大小再次爲1MB。jruby rails:Java :: JavaLang :: OutOfMemoryError:Java堆空間

每當我使用命令編譯我的資產rake assets:precompile RAILS_ENV=production我越來越低於錯誤。

Java::JavaLang::OutOfMemoryError: Java heap space 
org.mozilla.javascript.NativeArray.<init>(org/mozilla/javascript/NativeArray.jav 
a:66) 
org.mozilla.javascript.Context.newArray(org/mozilla/javascript/Context.java:1626 
) 
org.mozilla.javascript.ScriptRuntime.newArrayLiteral(org/mozilla/javascript/Scri 
ptRuntime.java:3733) 
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre 
ter.java:1776) 
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter. 
java:815) 
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret 
edFunction.java:109) 
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native 
Array.java:1635) 
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray 
.java:330) 
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb 
ject.java:97) 
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre 
ter.java:1479) 
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter. 
java:815) 
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret 
edFunction.java:109) 
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native 
Array.java:1635) 
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray 
.java:330) 
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb 
ject.java:97) 
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre 
ter.java:1479) 
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter. 
java:815) 
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret 
edFunction.java:109) 
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native 
Array.java:1635) 
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray 
.java:330) 
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb 
ject.java:97) 
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre 
ter.java:1479) 
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter. 
java:815) 
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret 
edFunction.java:109) 
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native 
Array.java:1635) 
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray 
.java:330) 
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb 
ject.java:97) 
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre 
ter.java:1479) 
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter. 
java:815) 
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret 
edFunction.java:109) 
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native 
Array.java:1635) 
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray 
.java:330) 
Tasks: TOP => assets:precompile 
(See full trace by running task with --trace) 

我該如何解決這個問題?

回答

1

嘗試使用備用ExecJS運行時(例如,具有安裝node

預編譯代替gem 'therubyrhino'

+0

我試圖耙資產...:預編譯EXECJS_RUNTIME = '節點' JRUBY_OPTS =「 - J-D32 -XC「,它爲我工作..謝謝 –

相關問題