我的应用程序在本地工作,但样式表在 Heroku 上不起作用。我很难理解为什么。
我正在使用 Heroku 的 Cedar 堆栈。
我的想法之一是我的资产没有成功预编译:
RAILS_ENV=production bundle exec rake assets:precompile
rake aborted!
Invalid CSS after "*/": expected "}", was ""
(in /path/to/app/assets/stylesheets/application.css)
谁能解释为什么预编译*/
在 application.css 的最后一行抱怨?它应该在那里。如果有人有修复,那也是理想的。
应用程序.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, 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 reset
*= require style
*= require projects
*= require_self
*/
更新 我试图在我的 application.css 中添加引号,但这并没有什么不同。我猜有些地方不对劲。但我无法预编译发送到heroku。当我加载网站时,几乎没有任何格式。