我希望这不是一个重复的问题;我在SO上尝试了其他解决方案,没有任何效果
当我的应用程序推送到Heroku时,推送失败,因为application.css无法编译。
我的终端输出:
Running: rake assets:precompile
rake aborted!
Sass::SyntaxError: Invalid CSS after " */": expected selector, was "@font-face"
(in /tmp/build_17e92975-ae8d-446f-8678-110eeeccfb64/app/assets/stylesheets/adminsite/application.css)
(sass):1845
尝试解决方案
我搜索并删除了../stylesheets/adminsite/目录中@ font-face之前的每个“* /”实例。同样的问题和结果。
我试过设置:
config.assets.compile = true
......同样的问题
编辑
这是我的application.css(不是应用程序级别1,而是adminsite目录中失败的那个)
/*
* 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, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, 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 top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require jquery.ui.all
*= require_self
*= require normalize
*= require ./global/plugins/bootstrap/css/bootstrap
*= require ./global/plugins/uniform/css/uniform.default
*= require ./global/plugins/bootstrap-switch/css/bootstrap-switch
*= require ./global/css/components
*= require ./global/css/plugins
*= require ./global/plugins/simple-line-icons/simple-line-icons
*= require ./admin/layout/css/layout
*= require ./admin/layout/css/themes/light2
*= require ./admin/layout/css/custom
*/
通过删除和重新整理,我发现了
*= require ./global/plugins/font-awesome/scss/font-awesome
从该列表的底部开始的是3,导致它失败。我现在可以在本地运行了
rake assets:precompile --trace RAILS_ENV=production
但是我无法使用
git push herokunb newbeta:master
解决了:
这是字体真棒CSS。删除它需要修复它。这个问题似乎没有解决,只是由于我自己的git错误。