heroku回形针图像出现,但随后消失 [英] heroku paperclip images appear but then disappear

查看:102
本文介绍了heroku回形针图像出现,但随后消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的应用上传到了heroku。该应用程序使用轨道上的红宝石构建,并安装了activeadmin和paperclip gem。这些文件配置正确,我可以使用他的活动管理宝石上传图像。这工作完全loaclly和heroku工作正常,直到我上传更多的图像,现在所有的图像已经消失。任何关于如何排序的想法?

com / articles / dynos#ephemeral-filesystemrel =nofollow>临时文件系统。
这是因为每个运行的dyno都是一个独立的容器(很像docker) dynos,并在应用程序重新启动/部署时被销毁。



因此,重新启动dyno时,磁盘上写入的任何文件都将丢失,并且无法恢复。 p>

您需要配置回形针将图像上传到专用文件存储系统,如 Amazon S3


I uploaded my app to heroku. The app was built with ruby on rails and had the activeadmin and paperclip gem installed. The files are configured properly and i was able to upload images using he active admin gem. this worked perfectly loaclly and worked fine on heroku until i uploaded more images, now all the images have disappeared. Any ideas on how this can be sorted?

解决方案

Heroku has an ephemeral filesystem.
That is because each running dyno is an independent container (much like docker) which shared nothing with other dynos, and is destroyed when the app is restarted/deployed.

So any file written on disk will be lost when the dyno is restarted, and is not recoverable.

You need to configure paperclip to upload images to a dedicated file storage system like Amazon S3.

这篇关于heroku回形针图像出现,但随后消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆