cdamian/paperclipftp — Issue #8: #reprocess! looks for the file locally
Author: stylpe
Created: 2012-02-17 20:08:33+00:00
State: open

I have the following model (with omitted sensitive info):

class Asset < ActiveRecord::Base
has_attached_file :file,
:styles => { :thumb => ["100x100>", ".png"] },
:path => "/app/#{ Rails.env}/:attachment/:id/:style/:filename",
:url => "http://***.com/~*user*/app/#{ Rails.env}/:attachment/:id/:style/:filename",
:storage => :ftp,
:ftp_credentials => Rails.root.join('config', 'paperclipftp.yaml')
validates_attachment_presence :file
delegate :url, to: :file
end

File uploads work fine and images get thumbnails properly.

At first I didn't specify that thumbs should be saved as .png, so when I tried uploading a pdf the thumb didn't display correctly. So I added the ".png" setting and tried to run the rake task:

$ rake paperclip:refresh:thumbnails CLASS=Asset
rake aborted!
No such file or directory - //app/development/files/2/original/tr11_03.pdf20120217-4756-auwcka.lock

Tasks: TOP => paperclip:refresh:thumbnails
(See full trace by running task with --trace)

So it looks like it tries to access the file locally. Same thing happens when I do it from the Rails console.