Carrierwave files with Capistrano

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

    How about this:

    # config/deploy.rb
    set :shared_children, shared_children + %w{public/uploads}
    

    :shared_children defaults to %w(public/system log tmp/pids) so we're just expanding this list.

    EDIT:

    Don't forget to run cap deploy:setup after changing :shared_children so that the new targets are created under shared.

    EDIT Capistrano 3:

    Capistrano 3 uses the linked_dirs setting and doesn't specify public/system as a default anymore.

    set :linked_dirs, fetch(:linked_dirs) + %w{public/system public/uploads}

提交回复
热议问题