Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

#reprocess! looks for the file locally #8

Open
stylpe opened this issue Feb 17, 2012 · 2 comments
Open

#reprocess! looks for the file locally #8

stylpe opened this issue Feb 17, 2012 · 2 comments

Comments

@stylpe
Copy link

stylpe commented Feb 17, 2012

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, which fixes it for new uploads. I then 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. This isn't critical for me since the error happened in my dev environment and new uploads aren't affected, but I thought I'd report my findings.

@coneybeare
Copy link

I see the same thing. Did you ever find a workaround?

@stylpe
Copy link
Author

stylpe commented Apr 13, 2012

Nope

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants