开发者

Rails 3.1 Asset Pipeline Fingerprinting

开发者 https://www.devze.com 2023-03-20 15:17 出处:网络
Simple question: I\'ve got a Rails 3.1 app running in staging, which is RAILS_ENV=production.My problem is this:stylesheet_link_tag produces a different fingerprint for my css files than the fingerpr

Simple question:

I've got a Rails 3.1 app running in staging, which is RAILS_ENV=production. My problem is this: stylesheet_link_tag produces a different fingerprint for my css files than the fingerprint that was produced by rake assets:precompile.

So when I request a page, the link to the stylesheet is looking for a file like:

/assets/front-1e3a4454e0d5434eccac1a053ca4c7fd.css

but in reality the file sitting in public/assets is

front-60b624d69d97b3ac5f288c54245a5ed5.css

and the browser returns a 404 Not Found.

Here is my linlk stylesheet_link_tag :front. Can anybody expla开发者_JS百科in to me why this happens?


I've been having the same exact issue. Best I can tell, this occurs when the precompile task runs during a capistrano deploy. I've had to remove the precompile from deployment and run the

rake assets:precompile RAILS_ENV=production from the release directory after the app has been deployed. It's a pain if you're pushing code frequently.

0

精彩评论

暂无评论...
验证码 换一张
取 消