ruby on rails - How do I symlink my product images in production on a Capistrano deploy? -
I have found a solution to my problem every time when I run my Spree Commerce app with Capistrano, my images Is still deleted, but folder names are incorrect) and I have to add them via admin.
On both questions and in that question it is said that there is a symlinking solution.
You need to make sure that your RARS_ROT / Public / Spree directory is being synchronized with the Captivates shared directory and whenever you deploy it, it is not being symlinked, Then your images will be lost on your deployment.
I have tried some things but I do not manage to symlink my pictures.
They are in the folder / public / spree / products on the server that I have tried:
Namespace: Deploying tasks: launching; Finished work: stop; End work: run symlink_shared run "ln -nfs # {shared_path} / shared / spree / # {release_path} / public / spree / end end
but it does not work I know It is not that I need to enter which shared path. I hope someone can help me or provide a link with an explanation.
If you are using Captianstorno 3 you can use the same method that I explained to you in the answer to your question.
In the pretext, : shared_children
do this in Capitolarano 2, but it has been removed in favor of : linked_file
and : linked_dirs
.
Just add your public / spree / directory to your repository
, add it to .gitignore
if you need it (it does not matter if it's git ), : linked_dirs
:
to use your deploy Rb
Set: Linked_Dearrs,% w (public / spree)
This is the way, when the capitrons are deployed, then automatically create a directory in share /
And link it to your current release Please keep in mind that if you need the files to be present in that directory, you can manually add them to share / share using the
. The same goes for files like rsync
database.yml
(for which you use : linked_files
).
Comments
Post a Comment