Ruby On Rails: Production / Staging : When asset path is outdated or latest changes in .js or .css is not reflecting


You have just updated an asset ( may be image file or script or stylesheet ), committed that and deployed that change to production or staging or qa or uat server.


For example: in case of image asset you have only edited the image may be added an icon in an sprite-image. You see that in browser no icon is rendered. When you inspect the DOM you see the URL is outdated. You know the URL is outdated because you have checked the Asset-precompile manifest your_app/current/public/assets/manifest-[digest].json  in the server which looks like

Inspection of not rendered image in production

Inspection of not rendered image in production


After you have deployed your rails server might not be restarted or some thing happened and your rails server failed to load new asset-manifest in memory by looking which Rails maps the asset requests.


Deploy your application again

if still not solved

  • SSH into the system delete the file your_app/manifest_backup
  • $ bundle exec rake assets:clear
  • $ bundle exec rake assets:precompile RAILS_ENV=production
  • restart the webserver ( for Nginx /etc/init.d/nginx restart or $ sudo service nginx restart )
  • if still not solved deploy your app again

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s