我无法解决生产环境的问题。我在 heroku 上的 application.css 是空的,而在开发中它很好。
在我的 application.rb 我添加了这个:
config.assets.enabled = true
config.assets.compress = false
但它仍然不起作用。
预编译也不起作用。在我完成之后,heroku 会发出一条消息,指出它已找到清单文件,但仍然 - 无法正常工作。为了回滚它,我使用了 rake assets:clean。该消息仍然出现。
我能做些什么?我只有一个没有 JS 的 CSS 文件。
链接到应用程序:http: //floating-hamlet-8270.herokuapp.com/
我的 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, 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_self
*= require_tree .
*/
html, body, h1, h2, h3, h4, h5, h6, p, ul, li {
margin: 0;
padding: 0;
}
body {
font-family: "Noto Sans", sans-serif;
}