简体   繁体   English

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

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

I've tried git push to a hosting service (not heroku). 我试过git push到托管服务(不是heroku)。 I typed the following commands on Windows. 我在Windows上键入了以下命令。

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

Then the following error is displayed on the hosting service screen. 然后在主机服务屏幕上显示以下错误。

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'
    .
    .
    .

Although there is the file name noimage-9f9de98ce95d5c9108e75feb33a04e35.gif on the first line of the error message, I saved app\\assets\\images\\noimage.gif locally. 尽管错误消息的第一行上有文件名noimage-9f9de98ce95d5c9108e75feb33a04e35.gif ,但我在本地保存了app\\assets\\images\\noimage.gif

Does this have something to do with the error? 这与错误有关吗?

There are some files in \\app\\assets\\javascripts . \\app\\assets\\javascripts有一些文件。

application.js 的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 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')
)

There are some other js.coffee files, but they don't have any code as below. 还有其他一些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/

How do I fix this problem? 我该如何解决这个问题?

I think noimage-9f9de98ce95d5c9108e75feb33a04e35.gif is a red herring--that's just the last successful log line before the error. 我认为noimage-9f9de98ce95d5c9108e75feb33a04e35.gif是一个红色鲱鱼,它只是错误之前的最后一个成功日志行。

That require statement at the end of your application.js should have a leading //= , I believe. 我认为application.js末尾的require语句应该有一个前导//= It's definitely not valid JS as written. 绝对不是写的有效JS。

暂无
暂无

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

相关问题 ExecJS::ProgramError: 运行 rake 资产时出现意外的标记 punc «(»,预期的 punc «:»:在生产中预编译 - ExecJS::ProgramError: Unexpected token punc «(», expected punc «:» when running rake assets:precompile on production ExecJS :: ProgramError:尝试为生产预编译资产时出现意外字符&#39;#&#39; - ExecJS::ProgramError: Unexpected character '#' when trying to precompile assets for production Heroku ExecJS :: ProgramError:意外令牌:错误导轨 - Heroku ExecJS::ProgramError: Unexpected token: error rails ExecJS :: ProgramError:意外字符“#” - ExecJS::ProgramError: Unexpected character '#' Heroku红宝石Rails 4与heroku ExecJS :: ProgramError:意外令牌:错误 - Heroku ruby rails 4 with heroku ExecJS::ProgramError: Unexpected token: error ExecJS :: ProgramError:SyntaxError:保留字“function” - ExecJS::ProgramError: SyntaxError: Reserved word “function” ExecJS :: RuntimeError:SyntaxError:意外的令牌:get @(execjs)中的punc()):3538:630 - ExecJS::RuntimeError: SyntaxError: Unexpected token: punc ()) from get@(execjs):3538:630 jQuery UI:在一种环境中,但在另一种环境中,“未捕获的语法错误:意外的令牌&lt;” - jQuery UI: “Uncaught Syntax Error: Unexpected token <” in one environment, but not another 将div附加到jQuery时无效或意外的令牌 - Invalid or unexpected token when a div is appended jquery 使用jquery.parsejson()时出现“意外令牌{” - “Unexpected token {” when using jquery.parsejson()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM