I'm developing a webapp with Rails, Paperclip and Heroku but since my last commit were I just added Google Analytics the most of the uploaded images disappeared! That's my link: http://wo42.herokuapp.com/ I don't know why that happened oO
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- What is the best way to do a search in a large fil
- Eager-loading association count with Arel (Rails 3
- Spring Integration - Inbound file endpoint. How to
相关文章
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- What is the correct way to declare and use a FILE
- Django/Heroku: FATAL: too many connections for rol
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
The actual issue here is that when you push to Heroku your application is re-deployed, and that won't be to the same machine that you were on before (it could be anywhere at any time).
Therefore, if you were uploading images to your local dynos filesystem, only that dyno had access to those files. When you deployed, that dyno would have been destroyed and a new one created.
This is why Heroku recommend that you use a persistent backing service such as S3 to store your uploaded and persisted files. This sort of service is available to all dynos and persists across deploys.
https://devcenter.heroku.com/articles/s3
Heroku never used to let you write to their file-system although they have recently introduced something calld the ephemeral file-system - this article explains it. Best option is to use S3.