Every time I deploy with Capistrano two images are removed from my page

主宰稳场 提交于 2019-12-25 10:57:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!