繁体   English   中英

git:ExecJS :: ProgramError:意外的令牌:推送到生产环境时的名称(jquery)

[英]git: ExecJS::ProgramError: Unexpected token: name (jquery) when push to production environment

我试过git push到托管服务(不是heroku)。 我在Windows上键入了以下命令。

rake assets:precompile
git add .
git commit -m "xxx"
git push origin master

然后在主机服务屏幕上显示以下错误。

I, [2014-11-08T09:28:48.280141 #22295]  INFO -- : Writing /var/repos/xxx/xxx/public/assets/noimage-9f9de98ce95d5c9108e75feb33a04e35.gif
rake aborted!
ExecJS::ProgramError: Unexpected token: name (jquery) (line: 12946, col: 8, pos: 364216)

Error
    at new JS_Parse_Error (<eval>:2316:10736)
    at js_error (<eval>:2316:10955)
    at croak (<eval>:2316:18665)
    at token_error (<eval>:2316:18802)
    at unexpected (<eval>:2316:18890)
    at semicolon (<eval>:2316:19363)
    at simple_statement (<eval>:2316:21849)
    at <eval>:2316:20090
    at <eval>:2316:19536
    at <eval>:2316:31209
  (in /var/repos/xxx/xxx/app/assets/javascripts/application.js)/var/repos/xxx/xxx/vendor/bundle/ruby/2.1.0/gems/execjs-2.0.2/lib/execjs/ruby_racer_runtime.rb:34:in `rescue in block in eval'
/var/repos/xxx/xxx/vendor/bundle/ruby/2.1.0/gems/execjs-2.0.2/lib/execjs/ruby_racer_runtime.rb:28:in `block in eval'
/var/repos/xxx/xxx/vendor/bundle/ruby/2.1.0/gems/execjs-2.0.2/lib/execjs/ruby_racer_runtime.rb:80:in `block in lock'
/var/repos/xxx/xxx/vendor/bundle/ruby/2.1.0/gems/therubyracer-0.10.2/lib/v8/c/locker.rb:13:in `Locker'
/var/repos/xxx/xxx/vendor/bundle/ruby/2.1.0/gems/execjs-2.0.2/lib/execjs/ruby_racer_runtime.rb:78:in `lock'
/var/repos/xxx/xxx/vendor/bundle/ruby/2.1.0/gems/execjs-2.0.2/lib/execjs/ruby_racer_runtime.rb:27:in `eval'
    .
    .
    .

尽管错误消息的第一行上有文件名noimage-9f9de98ce95d5c9108e75feb33a04e35.gif ,但我在本地保存了app\\assets\\images\\noimage.gif

这与错误有关吗?

\\app\\assets\\javascripts有一些文件。

的application.js

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require_tree .
require jquery.turbolinks

calendars.js.coffee

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$(document).ready( ->
  $('html, body').animate({ scrollTop: 0 }, 'slow')
)

还有其他一些js.coffee文件,但是它们没有下面的任何代码。

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

我该如何解决这个问题?

我认为noimage-9f9de98ce95d5c9108e75feb33a04e35.gif是一个红色鲱鱼,它只是错误之前的最后一个成功日志行。

我认为application.js末尾的require语句应该有一个前导//= 绝对不是写的有效JS。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM