我在本地运行这个
rake assets:precompile --trace RAILS_ENV=production
ruby :2.6.3
导轨:5.2.2
bundler :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
时成功
最佳答案
我认为你应该将 application.css 重命名为 application.scss 并删除 require tree 和 require self
关于css - (sass) :26096 How to fix 'Sass::SyntaxError: Invalid CSS after' error in Rails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56872571/