user2609980
user2609980

Reputation: 10474

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

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

?

Upvotes: 0

Views: 302

Answers (1)

GeekOnCoffee
GeekOnCoffee

Reputation: 1165

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.

Upvotes: 1

Related Questions