尝试在RoR中为生产预编译资产时出现ExecJS运行时错误

时间:2016-07-28 22:52:10

标签: ruby-on-rails jruby production precompile execjs

我最近尝试预编译Rails 4.2.6 CMS应用程序的资产,但是我收到此错误:

** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
rake aborted!
ExecJS::RuntimeError: SyntaxError: Unexpected token: name (type) (line: 5338, col: 20, pos: 251597)

Error
    at new JS_Parse_Error (/tmp/execjs20160728-10032-1xuzmtxjs:3623:11948)
    at js_error (/tmp/execjs20160728-10032-1xuzmtxjs:3623:12167)
    at croak (/tmp/execjs20160728-10032-1xuzmtxjs:3623:21858)
    at token_error (/tmp/execjs20160728-10032-1xuzmtxjs:3623:21995)
    at unexpected (/tmp/execjs20160728-10032-1xuzmtxjs:3623:22083)
    at as_property_name (/tmp/execjs20160728-10032-1xuzmtxjs:3624:357)
    at /tmp/execjs20160728-10032-1xuzmtxjs:3623:31739
    at /tmp/execjs20160728-10032-1xuzmtxjs:3623:22774
    at expr_atom (/tmp/execjs20160728-10032-1xuzmtxjs:3623:30807)
    at maybe_unary (/tmp/execjs20160728-10032-1xuzmtxjs:3624:1562)
    at expr_ops (/tmp/execjs20160728-10032-1xuzmtxjs:3624:2333)
    at maybe_conditional (/tmp/execjs20160728-10032-1xuzmtxjs:3624:2425)
    at maybe_assign (/tmp/execjs20160728-10032-1xuzmtxjs:3624:2868)
new JS_Parse_Error ((execjs):3623:11948)
js_error ((execjs):3623:12167)
croak ((execjs):3623:21858)
token_error ((execjs):3623:21995)
unexpected ((execjs):3623:22083)
as_property_name ((execjs):3624:357)
(execjs):3623:31739
(execjs):3623:22774
expr_atom ((execjs):3623:30807)
maybe_unary ((execjs):3624:1562)
expr_ops ((execjs):3624:2333)
maybe_conditional ((execjs):3624:2425)
maybe_assign ((execjs):3624:2868)
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:39:in `exec'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:21:in `eval'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:46:in `call'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/uglifier-3.0.1/lib/uglifier.rb:179:in `run_uglifyjs'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/uglifier-3.0.1/lib/uglifier.rb:141:in `compile'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/uglifier_compressor.rb:52:in `call'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/uglifier_compressor.rb:28:in `call'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `[]'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:134:in `block in find'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:133:in `each'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:133:in `find'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:185:in `compile'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:68:in `block in define'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-3.7.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:67:in `block in define'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/task.rb:248:in `block in execute'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/task.rb:243:in `each'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/task.rb:243:in `execute'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/stdlib/monitor.rb:214:in `mon_synchronize'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/task.rb:180:in `invoke_with_call_chain'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/task.rb:173:in `invoke'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:152:in `invoke_task'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:108:in `block in top_level'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:108:in `each'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:108:in `block in top_level'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:117:in `run_with_threads'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:102:in `top_level'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:80:in `block in run'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/lib/rake/application.rb:77:in `run'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/lib/ruby/gems/shared/gems/rake-11.2.2/exe/rake:27:in `<top>'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/bin/rake:22:in `load'
/home/vagrant/.rbenv/versions/jruby-9.1.2.0/bin/rake:22:in `<top>'
Tasks: TOP => assets:precompile

我不知道如何找到导致此问题的代码。该应用程序在开发模式下完美运行,我今天早上能够预先编译资产,所以我想我今天做了一些让这个问题发生的事情...有关如何找到它的任何提示吗?

0 个答案:

没有答案