gpt4 book ai didi

javascript - git: ExecJS::ProgramError: 推送到生产环境时出现意外的 token :名称 (jquery)

转载 作者:行者123 更新时间:2023-12-03 11:29:00 27 4
gpt4 key购买 nike

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

提取 Assets :预编译
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。

关于javascript - git: ExecJS::ProgramError: 推送到生产环境时出现意外的 token :名称 (jquery),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26812626/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com