S3 image attachment works, but reprocess looks locally

77 views
Skip to first unread message

coneybeare

unread,
Apr 13, 2012, 10:45:23 AM4/13/12
to Paperclip Plugin
Even though I have s3 specified and uploads/fetches working,
reprocess! want to look locally for the file instead.

>> a.image.url
=> "http://cloudfront.<REDACTED>.com/data/images/1/original.png?
1334279391"
>> a.image.reprocess!
Errno::ENOENT: No such file or directory - /data/images/1/original.png
from /Users/<REDACTED>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/
fileutils.rb:1515:in `stat'
from /Users/<REDACTED>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/
fileutils.rb:1515:in `block in fu_each_src_dest'
from /Users/<REDACTED>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/
fileutils.rb:1531:in `fu_each_src_dest0'
from /Users/<REDACTED>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/
fileutils.rb:1513:in `fu_each_src_dest'
from /Users/<REDACTED>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/
fileutils.rb:395:in `cp'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/io_adapters/attachment_adapter.rb:52:in
`copy_to_tempfile'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/io_adapters/attachment_adapter.rb:44:in
`cache_current_values'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/io_adapters/attachment_adapter.rb:6:in
`initialize'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/io_adapters/registry.rb:29:in `new'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/io_adapters/registry.rb:29:in `for'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/attachment.rb:91:in `assign'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
paperclip-3.0.1/lib/paperclip/attachment.rb:279:in `reprocess!'
from (irb):6
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
railties-3.2.0/lib/rails/commands/console.rb:47:in `start'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
railties-3.2.0/lib/rails/commands/console.rb:8:in `start'
from /Users/<REDACTED>/.rvm/gems/ruby-1.9.3-p125@<REDACTED>/gems/
railties-3.2.0/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

The image is setup like this:

has_attached_file :image,
:styles => { :mini => "24x24#", :thumb =>
"64x64#" },
:convert_options => { :mini => "-auto-
orient", :thumb => "-auto-orient" },
:storage => :s3,
:s3_credentials => "#{Rails.root.to_s}/config/
s3.yml",
:url => ':s3_alias_url',
:s3_host_alias => "cloudfront.<REDACTED>.com",
:path => "/data/images/:id/:style.:extension",
:bucket => '<REDACTED>',
:whiny => false

Other than reprocess!, the uploads and url methods of paperclip work
as expected. What am I doing wrong?
Reply all
Reply to author
Forward
0 new messages