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 directory application doesn’t contain the files I uploaded, because capistrano make a new version ….
=== Update ===
After all I use this :
inside :deploy namespace
task :symlink_uploads do
run "ln -nfs #{shared_path}/uploads #{release_path}/public/uploads"
end
and after:
after 'deploy:update_code', 'deploy:symlink_uploads'
=== Re Update ===
The solution of @tristanm is the best way to solve this.
How about this:
:shared_childrendefaults to%w(public/system log tmp/pids)so we’re just expanding this list.EDIT:
Don’t forget to run
cap deploy:setupafter changing:shared_childrenso that the new targets are created undershared.EDIT Capistrano 3:
Capistrano 3 uses the
linked_dirssetting and doesn’t specifypublic/systemas a default anymore.set :linked_dirs, fetch(:linked_dirs) + %w{public/system public/uploads}