【问题标题】:How to isolate the asset with errors when precompiling Rails assets?预编译 Rails 资产时如何隔离有错误的资产?
【发布时间】:2013-06-28 23:01:37
【问题描述】:

我在尝试预编译我的 Rails 应用程序资产时遇到此错误:

Unexpected token: operator (*) (line: 424, col: 9, pos: 14566)

我有许多单独的 CSS 和 JS 资产文件。我怎么知道这个错误的“*”标记是在哪一个中发现的?

xxx $ rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
xxx
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Unexpected token: operator (*) (line: 424, col: 9, pos: 14566)

【问题讨论】:

  • 我想我可以在预编译资产时将它们全部删除并一一添加。但有更快的方法吗?

标签: ruby-on-rails asset-pipeline


【解决方案1】:

试试rake assets:precompile:primary --trace,它会通过也不会通过。 如果它没有通过,有时它会显示另一条错误消息,这可能会有所帮助。

如果通过,请在public/assets 中搜索有问题的文件。它不会被缩小,因此您可以查看“下降”行(例如[line 424, col: 9,])并尝试查找错误。

【讨论】:

    猜你喜欢
    • 2016-10-14
    • 1970-01-01
    • 1970-01-01
    • 2017-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多