Ruby on rails 资产:使用uglify预编译失败

Ruby on rails 资产:使用uglify预编译失败,ruby-on-rails,node.js,bower,aws-opsworks,Ruby On Rails,Node.js,Bower,Aws Opsworks,你知道我该如何修复这个错误吗 环境 服务器:EC2(OpsWorks Rails应用程序) 操作系统:亚马逊2014.09 Ruby:Ruby 2.0.0p645(2015-04-13修订版50299)[x86_64-linux] 轨道:4.0.8 BowerRails:0.9.2(我也尝试了主分支的最新代码,但没有成功) 净现值:1.4.28 鲍尔:1.4.1 ExecJS.runtime:我试过RubyRacerRuntime和Node.js,但它们都不能在我的服务器上运行 注 ass

你知道我该如何修复这个错误吗

环境
  • 服务器:EC2(OpsWorks Rails应用程序)
  • 操作系统:亚马逊2014.09
  • Ruby:Ruby 2.0.0p645(2015-04-13修订版50299)[x86_64-linux]
  • 轨道:4.0.8
  • BowerRails:0.9.2(我也尝试了主分支的最新代码,但没有成功)
  • 净现值:1.4.28
  • 鲍尔:1.4.1
  • ExecJS.runtime:我试过RubyRacerRuntime和Node.js,但它们都不能在我的服务器上运行
  • assets:precompile
    在我的本地机器(mac)上运行良好
  • 我发现在我的服务器上使用asset:precompile的唯一方法是注释掉
    config.assets.js_compressor=:uglifier
    。(但我想丑化)
  • bower\u components/jquery/src/intro.js
    中,预编译总是失败(如果我手动修复intro.js中的语法错误,那么获取outro.js的错误)
错误
I[2015-07-10T06:54:41.017580#21463]信息--:Writing/srv/www/app/releases/20150710064958/public/assets/jquery/src/event-53bd66b3ef4e0030febbf883c4ccab1e.js
一、 [2015-07-10T06:54:41.034631#21463]信息--:Writing/srv/www/app/releases/20150710064958/public/assets/jquery/src/event/ajax-2728c2aeb59d870e609223e2a7549611.js
一、 [2015-07-10T06:54:41.057426#21463]信息--:Writing/srv/www/app/releases/20150710064958/public/assets/jquery/src/event/alias-b8026dcda8af25a845c9aaf6b812a0c3.js
一、 [2015-07-10T06:54:41.073036#21463]信息--:Writing/srv/www/app/releases/20150710064958/public/assets/jquery/src/event/support-7331020932640489d80faa12a4510a96.js
一、 [2015-07-10T06:54:41.093488#21463]信息--:Writing/srv/www/app/releases/20150710064958/public/assets/jquery/src/exports/amd-4a5f196c002a2a5f22de3dd642af82512.js
一、 [2015-07-10T06:54:41.131496#21463]信息--:Writing/srv/www/app/releases/20150710064958/public/assets/jquery/src/exports/global-fa942be8ff1d0bcc250cff98e5c45509.js
雷克流产了!
ExecJS::ProgramError:意外标记:eof(未定义)(行:46,列:0,位置:1394)
错误
在新的JS_解析_错误(:2357:10736)
at js_错误(:2357:10955)
在嘎嘎声中(:2357:18667)
at token_错误(:2357:18804)
意外时(:2357:18892)
在第二区(:2357:23918)
在ctor.body处(:2357:23572)
在函数处(:2357:23637)
原子膨胀时(:2357:26669)
大约一小时(:2357:29262)
(in/srv/www/app/releases/20150710064958/vendor/assets/bower_components/jquery/src/intro.js)/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:34:“eval中的块救援”
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:28:in`block in eval'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:80:in'block in lock'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:78:in'call'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:78:in'Locker'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:78:in'lock'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:27:in'eval'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby\u racer\u runtime.rb:19:in'exec'
/home/deploy/.bundler/app/ruby/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:176:in'really_compile'
/home/deploy/.bundler/app/ruby/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:100:in'compile'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/uglifier_compressor.rb:25:in'evaluate'
/home/deploy/.bundler/app/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:在“渲染”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in'block in evaluate'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in'each'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in'evaluate'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:25:在“初始化”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in'new'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:内置资产
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in'block in build_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in'cache_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in'build_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:在“查找资产”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in'find_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:在“查找资源中的块”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in'benchmark'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:在“查找资产”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:在“编译中的块”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in'each'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:在“编译”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:61:在“定义中的块(3个级别)”中
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in'with_logger'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:60:in“定义中的块(2个级别)”中
任务:TOP=>资产:预编译
(通过使用--trace运行任务查看完整跟踪)
----bundle exec rake资产的结束输出:预编译----
运行bundle exec rake资产:预编译返回1
[2015-
I, [2015-07-10T06:54:41.017580 #21463]  INFO -- : Writing /srv/www/app/releases/20150710064958/public/assets/jquery/src/event-53bd66b3ef4e0030febbf883c4ccab1e.js
I, [2015-07-10T06:54:41.034631 #21463]  INFO -- : Writing /srv/www/app/releases/20150710064958/public/assets/jquery/src/event/ajax-2728c2aeb59d870e60923e2a75492611.js
I, [2015-07-10T06:54:41.057426 #21463]  INFO -- : Writing /srv/www/app/releases/20150710064958/public/assets/jquery/src/event/alias-b8026dcda8af25a845c9aaf6b812a0c3.js
I, [2015-07-10T06:54:41.073036 #21463]  INFO -- : Writing /srv/www/app/releases/20150710064958/public/assets/jquery/src/event/support-7331020932640489d80faa12a4510a96.js
I, [2015-07-10T06:54:41.093488 #21463]  INFO -- : Writing /srv/www/app/releases/20150710064958/public/assets/jquery/src/exports/amd-4a5f196c0022a5f22de3dd642af82512.js
I, [2015-07-10T06:54:41.131496 #21463]  INFO -- : Writing /srv/www/app/releases/20150710064958/public/assets/jquery/src/exports/global-fa942be8ff1d0bcc250cff98e5c45509.js
rake aborted!
ExecJS::ProgramError: Unexpected token: eof (undefined) (line: 46, col: 0, pos: 1394)

Error
at new JS_Parse_Error (<eval>:2357:10736)
at js_error (<eval>:2357:10955)
at croak (<eval>:2357:18667)
at token_error (<eval>:2357:18804)
at unexpected (<eval>:2357:18892)
at block_ (<eval>:2357:23918)
at ctor.body (<eval>:2357:23572)
at function_ (<eval>:2357:23637)
at expr_atom (<eval>:2357:26669)
at maybe_unary (<eval>:2357:29262)
(in /srv/www/app/releases/20150710064958/vendor/assets/bower_components/jquery/src/intro.js)/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:34:in `rescue in block in eval'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:28:in `block in eval'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:80:in `block in lock'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:78:in `call'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:78:in `Locker'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:78:in `lock'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:27:in `eval'
/home/deploy/.bundler/app/ruby/2.0.0/gems/execjs-2.0.1/lib/execjs/ruby_racer_runtime.rb:19:in `exec'
/home/deploy/.bundler/app/ruby/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:176:in `really_compile'
/home/deploy/.bundler/app/ruby/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:100:in `compile'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/uglifier_compressor.rb:25:in `evaluate'
/home/deploy/.bundler/app/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:25:in `initialize'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `new'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `build_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:in `block in find_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in `benchmark'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:in `find_asset'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:in `block in compile'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `each'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `compile'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:61:in `block (3 levels) in define'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in `with_logger'
/home/deploy/.bundler/app/ruby/2.0.0/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:60:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
---- End output of bundle exec rake assets:precompile ----
Ran bundle exec rake assets:precompile returned 1
[2015-07-10T06:54:44+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Rake::Task["deploy:assets:precompile"].clear_actions
class PrecompileRequired < StandardError; end

namespace :deploy do
  namespace :assets do
    desc "Precompile assets if changed"
    task :precompile do
      on roles(:app) do
        #invoke 'deploy:assets:precompile_changed'
        within release_path do
          execute <<-EOCOMMAND
            (cd #{release_path}/vendor/assets
             bundle exec rake assets:precompile)
          EOCOMMAND
        end
      end
    end
  end
end