问题
Is there an easy way to you this with the asset pipeline and deploying to heroku / s3?
I would like my local rails app to use image/css/js locally as per normal.
And when you pre-compile, is there an easy way for the production app to serve it's assets from s3 (while dev assets are local). And also when you pre-compile / deploy to heroku, the newly compiled assets are sent up to s3 automatically?
This is so the developer (me :D ) does not have to keep manually updating s3 with the new deployed files?
Thanks.
回答1:
I believe this is what you're looking for:
http://ckdake.com/content/2011/rails-31-assets-on-s3-with-https.html
Make sure you use up-to-date gems, as this guide is for rails 3.1 (in case you use 3.2+)
回答2:
Heroku has good docs on this now, here:
https://devcenter.heroku.com/articles/cdn-asset-host-rails31
Which recommends this gem:
https://github.com/rumblelabs/asset_sync
来源:https://stackoverflow.com/questions/9822245/is-there-a-way-to-asset-pipeline-assets-to-s3-when-pushing-to-heroku