My specific problem turned out to be some code hiding in application.rb
...
how I found it
I added puts config.assets.precompile.inspect
to config/environments/production.rb
and marvelled at the regex it output. Then I searched the codebase for "config.assets.precompile" and lo, in application.rb, there was:
config.assets.precompile << /(^[^_/]|/[^_])[^/]*$/
...
config.assets.precompile += ["*.js", "*.css", "jquery-migrate-rails.js"]
which was causing the problem. (I'm slightly puzzled as I've triple checked those regexes and they shouldn't be picking up _alerts.scss... but lets gloss over that and focus on the fact that removing those lines fixed it)
Maybe this will help someone else...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…