Carrierwave files with Capistrano

后端 未结 5 1014
轮回少年
轮回少年 2020-12-07 21:18

I\'m using rails 3.2 with asset and carrierwave for upload some images, they store in /public/uploads/photo/..... but when I do a cap:deploy (with capistrano) my current d

5条回答
  •  醉酒成梦
    2020-12-07 21:35

    With Capistrano 3 and without needing to redeploy.

    Like @tristanm mentioned add this to your config/deploy.rb

    # config/deploy.rb
    set :linked_dirs, fetch(:linked_dirs) + %w{public/uploads}
    

    To have capistrano create shared/public/uploads

    cap deploy:check:linked_dirs

    Now cap can create the symlink

    cap deploy:symlink:shared

    Finally, if you have backups of the uploads you can put them in shared/public/uploads/ and they should work without needing to redeploy.

提交回复
热议问题