【问题标题】:Assets pipeline is turned off but "error compiling assets"资产管道已关闭,但“编译资产时出错”
【发布时间】:2015-06-19 16:07:45
【问题描述】:

我的 Rails 4 应用的production.rb 包含以下配置:

  config.serve_static_files = true

  # Compress JavaScripts and CSS.
  # config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  # config.assets.compile = true

  # Generate digests for assets URLs.
  # config.assets.digest = true

  config.assets.debug = true
  config.assets.enabled = false

但我在 heroku 有一个错误 Error Compiling CSS asset ... .css

【问题讨论】:

  • 请提供有关您收到的错误的更多信息。无法用给定的信息来回答。
  • 嗯,看看main.css,里面有错误。不明白的请看 main.css 的相关部分或在这里发帖。
  • @martin,如您所见,我禁用了 css 编译。它在 localhsot 上运行良好。
  • @MarioHonse 你没有关闭资产编译。请关注这个帖子:stackoverflow.com/questions/23687972/…,你有 config.assets.enabled = false 而不是 config .assets.compile = false,那么我的回答是有道理的,因为你的 Sass 编译器工作并抛出这个错误..
  • @JanStrnádek,我所做的与该答案有何不同?

标签: ruby-on-rails ruby ruby-on-rails-4 heroku assets


【解决方案1】:

这不是资产管道的问题,您的 SASS 文件无效!请检查你的括号。会是这样的

.test-div {
  .novinka {
    padding-top: 10px;

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-19
    • 2013-05-08
    • 2023-03-31
    • 2013-01-15
    • 1970-01-01
    • 2016-04-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多