Ruby on rails Rails/Heroku:找不到ExecJS SyntaxError的源意外标记:eof(未定义)

Ruby on rails Rails/Heroku:找不到ExecJS SyntaxError的源意外标记:eof(未定义),ruby-on-rails,ruby-on-rails-4,heroku,asset-pipeline,uglifyjs,Ruby On Rails,Ruby On Rails 4,Heroku,Asset Pipeline,Uglifyjs,我正试图根据设置资产管道,但当我在控制台输入此命令时: rake assets:precompile RAILS_ENV=production 我得到这个错误: rake aborted! ExecJS::ProgramError: SyntaxError: Unexpected token: eof (undefined) (line: 46, col: 0, pos: 1394) Error at new JS_Parse_Error (<eval>:3623:119

我正试图根据设置资产管道,但当我在控制台输入此命令时:

rake assets:precompile RAILS_ENV=production
我得到这个错误:

rake aborted!
ExecJS::ProgramError: SyntaxError: Unexpected token: eof (undefined) (line: 46, col: 0, pos: 1394)

Error
    at new JS_Parse_Error (<eval>:3623:11948)
    at js_error (<eval>:3623:12167)
    at croak (<eval>:3623:22038)
    at token_error (<eval>:3623:22175)
    at unexpected (<eval>:3623:22263)
    at block_ (<eval>:3623:28063)
    at ctor.body (<eval>:3623:27686)
    at function_ (<eval>:3623:27782)
    at expr_atom (<eval>:3623:31068)
    at maybe_unary (<eval>:3624:1752)
new JS_Parse_Error ((execjs):3623:11948)
js_error ((execjs):3623:12167)
croak ((execjs):3623:22038)
token_error ((execjs):3623:22175)
unexpected ((execjs):3623:22263)
block_ ((execjs):3623:28063)
ctor.body ((execjs):3623:27686)
function_ ((execjs):3623:27782)
expr_atom ((execjs):3623:31068)
maybe_unary ((execjs):3624:1752)
V8::Error: SyntaxError: Unexpected token: eof (undefined)
at js_error (<eval>:3623:12167)
at croak (<eval>:3623:22038)
at token_error (<eval>:3623:22175)
at unexpected (<eval>:3623:22263)
at block_ (<eval>:3623:28063)
at ctor.body (<eval>:3623:27686)
at function_ (<eval>:3623:27782)
at expr_atom (<eval>:3623:31068)
at maybe_unary (<eval>:3624:1752)
at expr_ops (<eval>:3624:2523)
at maybe_conditional (<eval>:3624:2615)
at maybe_assign (<eval>:3624:3058)
at expression (<eval>:3624:3384)
at expr_list (<eval>:3623:31548)
at subscripts (<eval>:3624:1461)
at expr_atom (<eval>:3623:31132)
at maybe_unary (<eval>:3624:1752)
at expr_ops (<eval>:3624:2523)
at maybe_conditional (<eval>:3624:2615)
at maybe_assign (<eval>:3624:3058)
at expression (<eval>:3624:3384)
at expr_atom (<eval>:3623:30820)
at maybe_unary (<eval>:3624:1752)
at expr_ops (<eval>:3624:2523)
at maybe_conditional (<eval>:3624:2615)
at maybe_assign (<eval>:3624:3058)
at expression (<eval>:3624:3384)
at simple_statement (<eval>:3623:25942)
at <eval>:3623:23902
at <eval>:3623:22954
at <eval>:3624:3759
at parse (<eval>:3624:3999)
at parse (<eval>:3958:22)
at uglifier (<eval>:4003:13)
Tasks: TOP => assets:precompile
我查看了上面提到的目录,没有看到任何相关文件。我在整个系统中搜索了“execjs20170121-47471-7jr3ee”和“execjs20170121-47471-7jr3eejs”,但没有找到运气

从我在其他帖子中读到的内容来看,在解析我的Javascript时,Uglifier似乎出错了,但同样,我不知道该去哪里修复它

有什么想法吗?

我也有同样的问题。 由于使用“RAILS\u ENV=production”运行命令,您应该在生产日志中看到错误。 我的生产日志指向第39行exec中的:
/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb

这是一行:

 extract_result(@runtime.exec_runtime(filepath), filepath)
虽然这行对我来说毫无意义,但很明显这是一个“文件路径”问题。 您的某些字体可能没有正确定义。 如前所述,您应该使用
或sass-rails引用字体URL 如果仍然不起作用,请尝试更改:
config.assets.compile=false
如前所述,在production.rb中编译为config.assets.compile=true

 extract_result(@runtime.exec_runtime(filepath), filepath)