【问题标题】:(sass):26096 How to fix 'Sass::SyntaxError: Invalid CSS after' error in Rails(sass):26096 如何修复 Rails 中的“Sass::SyntaxError: Invalid CSS after”错误
【发布时间】:2019-07-03 14:40:07
【问题描述】:

我在本地运行这个

rake assets:precompile --trace RAILS_ENV=production

红宝石:2.6.3

导轨:5.2.2

捆绑器:2.0.2

美洲狮:3.12.1

这是我的 CSS application.css

 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */
*= require font-awesome.css
*= require bootstrap.css
*= require font-awesome.css
*= require lineicons.css
*= require mystyles.css
*= require styles.css
*= require weather-icons.css

错误日志

Sass::SyntaxError: Invalid CSS after "...ather-icons.css": expected "{", was ""
(sass):26096

我希望在运行rake assets:precompile --trace RAILS_ENV=production 时成功

【问题讨论】:

    标签: css sass ruby-on-rails-5.2 precompile


    【解决方案1】:

    我认为您应该将 application.css 重命名为 application.scss 并删除 require 树和 require self

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-01
      • 2015-07-05
      • 2019-04-29
      • 2020-06-06
      • 2017-01-20
      • 1970-01-01
      • 1970-01-01
      • 2013-01-04
      相关资源
      最近更新 更多