Posted on / by Bondan Herumurti / in Ruby On Rails

Capistrano Lyfe, The Culprit Of Missing Image on Paperclip

We love using capistrano to deploy our apps to vps, the “one line command to build them all” is just beyond awesome compare to the oldies ftp and sftp

BUT

without a proper configuration, it may lead to disaster esp on the paperclip gem configuration, every time we build and we lose all the image, 2 images are fine, but gazillion images will bring you trouble to reupload it again

THEREFORE

set :linked_dirs, fetch(:linked_dirs, []).push('public/system')

rather than put your image on current folder, this line told the machine to create the folder on shared folder and soft link it into current folder

therefore, you’ll never lose your images again

 

Happy Coding!

Leave a Reply