简体   繁体   中英

RoutingError for previous uploaded images after Capistrano deploy

I have a Rails 5.1 application with functionality for uploading documents.

I implemented the upload-functionality with Paperclip (version 5.1). The uploads are stored on Amazon S3. Uploading documents works fine initially, but previously uploaded images are broken when I redeploy the application with Capistrano to the production server. When I look in the production.log I see this RoutingError:

    F, [2017-11-06T14:07:26.682736 #446] FATAL -- : [012253d0-c103-4e57-8065-33830ad76b9b] ActionController::RoutingError

(No route matches [GET] "/system/absences/attest_pics/000/000/008/original/boekcover.jpg"):

in the View I implemented the link to the document like this:

        <% if absence.attest_pic.present? %>
        <td>
          <%= link_to "Download", absence.attest_pic.url %>
        </td>
        <% end %>

Does anyone has experience with this behaviour?

Thanks for your help,

Anthony

Take a look in your folder, in the server. If the path your_app/current/public/system don't exists, you need to change the file: config/deploy.rb accept the public/system

set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM