Rails 4 assets manifest.json recent digest

assets, manifest, ruby-on-rails, sprockets

Solution

the `manifest.json` always has a random `SecureRandom.hex(16)` attached to it's name. Taking a look at `manifest` you can see that Sprockets takes the first available file.

If you see multiple `manifest-*.json` files on your server, it might get risky since Sprockets doesn't really choose the newest file and you may end up with loading outdated assets.

Just run the following and you're good to go:

bundle exec rake assets:clobber
bundle exec rake assets:precompile

Problem

I have a few manifest files with digest on the deploy server ``` manifest-bcba79cf9483d404e9951992bbe38e46.json manifest-7db402a1216c2425e0f881b6331ba27d.json ... ``` How sprockets know which of manifests is recent? Or it should be only one manifest file? Regards

Original source