in , ,

Rails to Heroku: Static Assets

This little situation would have caused me some grief, had it not been for some advice I got when it occurred.

When you create a new Rails app and you’ve made changes to your static assets (CSS files for example) there’s a config file that needs to be updated with your static asset changes. Without this change, it will work locally with your static asset changes – but a deployment to Heroku or some other host will only show your old assets. At first I thought this was a cache issue… until I was told about this:

You need to go to your app’s file:

and edit this line from false to true:
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true

Now redeploy and you’re static assets will compile and be available in your production environment.

What do you think?

0 points
Upvote Downvote

Total votes: 0

Upvotes: 0

Upvotes percentage: 0.000000%

Downvotes: 0

Downvotes percentage: 0.000000%

Written by Admin

I work for a Telecom company writing and testing software. My passion for writing code is expressed through this blog. It's my hope that it gives hope to any and all who are self-taught.


Leave a Reply


R: Reading Data

Rails, Devise, Heroku and SendGrid