Reputation: 1645
I deployed a simple React+Rails Blog application on Heroku. I deployed separate projects for frontend and backend.
Everything in the application is working fine but the issue is that images disappeared after some time due to routing error. The same URL works for some time but then it stops working.
First I was uploading images using active_storage
and faced this issue and now I am using carrierwave
but the issue is still there. I tried different solutions but nothing worked.
I am facing issue only on production and not on localhost.
Heroku Logs
Production.rb
Upvotes: 1
Views: 477
Reputation: 1447
As of 2020/10/11, Heroku documentation on ActiveStorage says
Heroku has an “ephemeral” hard drive, this means that you can write files to disk, but those files will not persist after the application is restarted
Recommendation by the same document is
Instead of storing uploaded files to disk, the best practice is to leverage a cloud file storage service such as Amazon’s S3.
AFAIR, Heorku CLI warns you of this fact. You should have noticed that.
Upvotes: 4