Rails 4 has introduced many new and exciting features, but it's very new technology and one of the most important features, asset pipelines is causing many people headaches. If you use Phusion Passenger with Rails 4 and Ruby 2, you may encounter these problems:
Usually you will get a message that looks like this:- Pre-compiled fingerprints used for some assets, but not others.
- Mismatch between pre-compiled hashes and the hashes that production assigns (i.e. fingerprint mismatches) not resolved by re-compiling the assets.
ActionController::RoutingError (No route matches [GET]with the asset following in quotes.
We found that the following helped resolve the problems:
- Append "RAILS_ENV=production RAILS_GROUPS=assets" to your rake assets:precompile line. I.e.: bundle exec rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets
- Make Rails use digest: config.assets.digest = true
- Enable fallback to assets pipeline: config.assets.compile =true