Carrierwave files with Capistrano

后端 未结 5 1011
轮回少年
轮回少年 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:42

    Capistrano creates new directory for every deploy.

    There are some exceptions to it. For example, the log files are shared between the deployment directories because they are just symlinks. You have to create a symlink for public/uploads as well.

    Here is the command:

    run <<-CMD
      rm -rf #{latest_release}/public/uploads &&
      ln -s #{shared_path}/uploads #{latest_release}/public/uploads
    CMD
    

提交回复
热议问题