2017-03-01 119 views
0

我嘗試使用Capistrano將我的Rails應用部署到AWS。Rake的資產:預編譯未能部署到AWS

我跑cap production deploy後,我得到了下面的跟蹤一個「耙中止」消息:

ExecJS::ProgramError: SyntaxError: Unexpected character '’' (line: 19420, col: 10, pos: 548371) 

Error 
    at new JS_Parse_Error (<eval>:3623:11948) 
    at js_error (<eval>:3623:12167) 
    at parse_error (<eval>:3623:14184) 
    at Object.next_token [as input] (<eval>:3623:19902) 
    at next (<eval>:3623:21852) 
    at subscripts (<eval>:3624:1389) 
    at expr_atom (<eval>:3623:31205) 
    at maybe_unary (<eval>:3624:1752) 
    at expr_ops (<eval>:3624:2523) 
    at maybe_conditional (<eval>:3624:2615) 
new JS_Parse_Error ((execjs):3623:11948) 
js_error ((execjs):3623:12167) 
parse_error ((execjs):3623:14184) 
Object.next_token [as input] ((execjs):3623:19902) 
next ((execjs):3623:21852) 
subscripts ((execjs):3624:1389) 
expr_atom ((execjs):3623:31205) 
maybe_unary ((execjs):3624:1752) 
expr_ops ((execjs):3624:2523) 
maybe_conditional ((execjs):3624:2615) 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:47:in `rescue in block in call' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:44:in `block in call' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:75:in `block in lock' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:in `Locker' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:in `lock' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:43:in `call' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/uglifier-3.0.4/lib/uglifier.rb:184:in `run_uglifyjs' 
/Users/apple/.rvm/gems/ruby-2.3.3/gems/uglifier-3.0.4/lib/uglifier.rb:146:in `compile' 

,這並不能給我的語法錯誤的特定位置,我該如何定位呢? 在此先感謝!

回答

2

地發現,作爲波紋管使用該代碼的問題更普遍的方式:

運行rails console

JS_PATH = "app/assets/javascripts/**/*.js"; 
Dir[JS_PATH].each do |file_name| 
    puts "\n#{file_name}" 
    puts Uglifier.compile(File.read(file_name)) 
end 

它會告訴你該文件,並在Uglifier正在問題就行了。

+0

¡真棒代碼!謝謝......我可以解決我的問題,以配合我的部署@khanhpham –

相關問題