I\'m using Ruby 2.0.0-p247
and Rails 4.0.0
If I make a minimal Rails 4 site like this:
rails new minimal
cd minimal
rails g
I was able to resolve asset links not including the digest by bumping the asset version number.
# Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.0'
+ config.assets.version = '2.0'
You'll find this either in config/application.rb
if you're upgrading or in the newer location config/initializers/asset.rb
While I was writing up this question I came across this blog post which suggests it is a bug.
http://railsblog.kieser.net/2013/08/rails4-phusion-passenger-asset-pipeline.html
Of the various suggestions, just setting the compilation fallback true...
config.assets.compile = true
seems to be sufficient to kick Rails in to generating appropriately digested URLs:
<link data-turbolinks-track="true" href="/assets/application-f1a14051f17824976271b9c0460232f0.css" media="all" rel="stylesheet" />
<script data-turbolinks-track="true" src="/assets/application-723d1be6cc741a3aabb1cec24276d681.js"></script>
The other suggestion, explicitly setting RAILS_ENV and RAILS_GROUPS seemed to produce different digest strings on the precompiled files, but they always seem to match up with the generated HTML regardless.