Is there a way to asset pipeline assets to s3 when pushing to heroku?

橙三吉。 提交于 2019-12-09 13:41:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!