{"action":"created","issue":{"url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/455","labels_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/455/comments","events_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/455/events","html_url":"https://github.com/heroku/heroku-buildpack-ruby/issues/455","id":129814634,"number":455,"title":"Rails assets:precompile doesn't know about env?","user":{"login":"Machiaweliczny","id":5442370,"avatar_url":"https://avatars.githubusercontent.com/u/5442370?v=3","gravatar_id":"","url":"https://api.github.com/users/Machiaweliczny","html_url":"https://github.com/Machiaweliczny","followers_url":"https://api.github.com/users/Machiaweliczny/followers","following_url":"https://api.github.com/users/Machiaweliczny/following{/other_user}","gists_url":"https://api.github.com/users/Machiaweliczny/gists{/gist_id}","starred_url":"https://api.github.com/users/Machiaweliczny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Machiaweliczny/subscriptions","organizations_url":"https://api.github.com/users/Machiaweliczny/orgs","repos_url":"https://api.github.com/users/Machiaweliczny/repos","events_url":"https://api.github.com/users/Machiaweliczny/events{/privacy}","received_events_url":"https://api.github.com/users/Machiaweliczny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-29T16:25:42Z","updated_at":"2016-01-29T16:45:55Z","closed_at":null,"body":"Guys today I've came into this issue:\r\nI've had deployed app with some method in templates that uses ENV variable to generate link paths.\r\nThen I've changed this variable and was wondering why templates doesn't change. \r\n\r\nSeems like this buildpack caches assets using `MD5` without evaluation  of `.erb`. It took me a while to get why it's not updated so I suggest you either check for changes in ENV while rebuilding assets or maybe run them through .erb or maybe add some info? What you thing about it?\r\n\r\nSolution was to change `Rails.application.config.assets.version`. And maybe it's proper way to solve it and nothing should be changed."},"comment":{"url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/comments/176855631","html_url":"https://github.com/heroku/heroku-buildpack-ruby/issues/455#issuecomment-176855631","issue_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/455","id":176855631,"user":{"login":"schneems","id":59744,"avatar_url":"https://avatars.githubusercontent.com/u/59744?v=3","gravatar_id":"","url":"https://api.github.com/users/schneems","html_url":"https://github.com/schneems","followers_url":"https://api.github.com/users/schneems/followers","following_url":"https://api.github.com/users/schneems/following{/other_user}","gists_url":"https://api.github.com/users/schneems/gists{/gist_id}","starred_url":"https://api.github.com/users/schneems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schneems/subscriptions","organizations_url":"https://api.github.com/users/schneems/orgs","repos_url":"https://api.github.com/users/schneems/repos","events_url":"https://api.github.com/users/schneems/events{/privacy}","received_events_url":"https://api.github.com/users/schneems/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T16:45:55Z","updated_at":"2016-01-29T16:45:55Z","body":"> Guys today I've came into this issue:\r\n\r\nWe employ engineers of different genders.\r\n\r\nAs a note MD5 isn't used, hashes are default generated via SHA256 https://github.com/rails/sprockets/blob/a7b20d571012318de6271290fae6c96c06d86635/lib/sprockets/digest_utils.rb#L16, though that's not important to this issue.\r\n\r\nI agree with Damien, putting env vars in your assets will cause confusing failures. For instance even though apps restart after env vars are changed assets will not be re-compiled, this is expected behavior. it is possible to change the way that a cache key for an asset is evaluated for example changing the `asset_host` in rails will change the SHA which will cause a re-compile. It may be technically possible to do what you want in rails, but it's not the normally recommended thing. \r\n\r\nWhat are you using ENV vars for you your assets?\r\n"}}