0

I have a custom.css.scss file in my assets/stylesheets folder where I've added new css.

All stylesheets work in development but in production the custom.css file isn't included ie no customm.css style changes are implemented in production.

In application.rb I have:

config.assets.initialize_on_precompile = false
config.assets.enabled = true

In production.rb I have:

config.assets.compile = true

In my application.html.erb I have:

<%= stylesheet_link_tag "application" %>

In application.css I have:

 *= require_self
 *= require foundation_and_overrides
 *= require_tree .
 */

My app is on Heroku

1 Answer 1

1

Problems you are described may be related to Heroku does not precompile assets when deploying

As assets are precompiled for production, you may add it to config.assets.precompile in your environment.rb as described there http://jalada.co.uk/2012/01/23/adding-files-to-config-assets-precompile-in-rails-3-1.html

config.assets.precompile += %w(custom.css)
Sign up to request clarification or add additional context in comments.

4 Comments

Wouldn't *= require_tree . be sufficient?
hm, yes, it seems it should. Have you checked following stackoverflow.com/questions/17664802/… ? May your problem be related to one of the items listed there?
Thanks Mike. I had to delete my public/assets folder. I've never had to do it before. Weird.
you are welcome. Based on it I've updated the answer to make it helpful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.