1
votes

I uploaded few files using paperclip gem and now they are gone. I am wondering what caused the deletion of the uploaded files. According to the paperclip documentation.

The files that are assigned as attachments are, by default, placed in the directory specified by the :path option to has_attached_file. By default, this location is :rails_root/public/system/:class/:attachment/:id_partition/:style/:filename. This location was chosen because, on standard Capistrano deployments, the public/system directory can be symlinked to the app's shared directory, meaning it survives between deployments. For example, using that :path, you may have a file at

/data/myapp/releases/20081229172410/public/system/users/avatar/000/000/013/small/my_pic.png

I did few capistrano deployments after uploading the files but the uploaded files should survive. I am wondering what caused the files deletion. Thanks for help!

1

1 Answers

1
votes

Make sure you are sharing the public/system directory between your releases. Otherwise each release will start with a blank slate.

# deploy.rb
append :linked_dirs, "public/system"