Why is this new CSS manifest file not compiled at compile time with Heoku, while the normal application manifest works fine?
I have Rails 3.2.11 running on a Heroku cedar stack. I don't compile the assets locally, they are compiled automatically at compile time slug as described here . I just created a new CSS manifest file app/assets/stylesheets/new_manifest.css.scss
in addition to the default application.css.scss
. When I click on Heroku, this manifest file doesn't compile like application.css.scss
is. The new manifest file works great in development. Why is this happening?
application.rb
config.assets.enabled = true
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
production.rb
config.assets.compile = false
config.serve_static_assets = false
config.assets.compress = true
config.assets.digest = true
Console logout from Heroku push
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (83.62s)
Sample page
<%= stylesheet_link_tag "new_manifest", media: "all" %>
source to share
If you say that your new_manifest
- a manifest file, it must be included in the main manifesto for the application: application.css
. If you include it stylesheet_link_tag
, it is not under pipeline control (it is treated as a pure CSS file, not as a manifest). It should also be precompiled, but inclusion should be ignored. There is a better way to include additional manifest files in the main file application.css
: index files (see 2.1.2).
source to share