【问题标题】:Rails 3.2 sass error on application.css precompile在 application.css 预编译上的 Rails 3.2 sass 错误
【发布时间】:2012-10-17 16:15:54
【问题描述】:

升级到 rails 3.2 后,rake assets:precompile 出现此错误

Invalid CSS after "*": expected "{", was "html .fileinput..."

这是跟踪:http://paste.ubuntu.com/1285319/

application.css 几乎是默认值:

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
 * the top of the compiled file, but it's generally better to create a new file per style scope.
 *= require_self 
 *= require_tree . 
*/

显然它不喜欢 CSS 中的 cmets,是否有一些我没有注意到的 SASS 或 Rails 变化?

这里是 sass 的版本:

sass (3.2.1)
sass-rails (3.2.5)
  railties (~> 3.2.0)
  sass (>= 3.1.10)
  tilt (~> 1.3)

【问题讨论】:

  • 你能粘贴包含html .fileinput...的css文件吗?
  • 我不知道你是什么意思...样式表插入<%= stylesheet_link_tag "application" %>标准方式
  • assets/stylesheets中还有其他文件吗? Rails 不能反对 CSS 中的 cmets,在这方面没有任何改变。
  • 是的,当然。有很多...

标签: ruby-on-rails ruby-on-rails-3.2 asset-pipeline assets


【解决方案1】:

错误是由jquery.fileupload-ui.css (jQuery File Upload UI Plugin CSS 6.3) 中的这一行引起的

/* Fix for IE 6: */
*html .fileinput-button {
  line-height: 22px;
  margin: 1px -3px 0 0;
}

【讨论】:

    猜你喜欢
    • 2012-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-08
    相关资源
    最近更新 更多