问题
I have a Spree Webshop Ruby on Rails application. Every time I run cap deploy
and I look at my page, two of the three product images that are displayed on the mainpage are gone.
The two images still display at the admin page as an alternative text (so not the actual image). When I click it I get the following message:
No route matches [GET] "/spree/products/7/product/imagename.png"
Rails.root: /rails/releases/20140127203640
There is no difference between how I handled the images, I all added them yesterday to the page. I have no idea how this can be so I don't know what extra information to post. Anyone any idea how this is possible?
/EDIT So one idea was to symlink the public/spree directory on the server with the Capistrano directory (?). How do I do this
namespace :deploy do
task :symlink_shared do
run "ln -nfs #{shared_path}/public/spree/ #{release_path}/public/spree/"
end
?
回答1:
You need to make sure that your RAILS_ROOT/public/spree
directory is being symlinked in from the Capistrano shared directory and not recreated every time you deploy. If this symlink isn't happening, your images will be lost on every deploy.
来源:https://stackoverflow.com/questions/21391294/every-time-i-deploy-with-capistrano-two-images-are-removed-from-my-page