(sass):26096如何修复Rails中的'Sass :: SyntaxError:之后无效CSS'错误

时间:2019-07-03 14:40:07

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

我在本地运行

rake assets:precompile --trace RAILS_ENV=production

红宝石:2.6.3

rails: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

1 个答案:

答案 0 :(得分:0)

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