0

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

?

user2609980
  • 10,264
  • 15
  • 74
  • 143

1 Answers1

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.

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
GeekOnCoffee
  • 1,155
  • 5
  • 15
  • I have three products, and only two are lost. How do I symlink the spree_directory? Do you mean that i should add an extra line to deploy.rb? And if so, which? – user2609980 Feb 01 '14 at 10:41
  • see my updated answer for what I tried. I have no idea what the Capistrano shared directory is. – user2609980 Feb 01 '14 at 10:52
  • On the server in rails/current/public/spree/products I do see all three products, but of the three images folder only the 3rd one has number 3, the other one have 12 and 13 and after I removed and updated them it became 14 and 15... – user2609980 Feb 01 '14 at 11:04
  • Can you explain how I do this symlinking? Still have not managed to solve it. – user2609980 Feb 13 '14 at 21:17
  • can you explain how to do this? – user2609980 Feb 21 '14 at 20:06