thoughtbot/paperclip — Issue #702: S3 url missing :id param for particular style 
Author: coolbox
Created: 2012-01-13 23:14:54+00:00
State: open

Hey,

I've been working with Paperclip and uploading to Amazon S3 (because of using Heroku) absolutely fine for a while now. However, i've just run into an issue where all my images are loading fine, except for one particular style on a model.

It appears on this particular model that url is simply missing the :id param from the url string.

For example this style works fine and the url is: http://s3-eu-west-1.amazonaws.com/MY_BUCKET/user/avatars/3/profile/FILENAMEpng

However, the style that isn't working is producing the following url's: http://s3-eu-west-1.amazonaws.com/MY_BUCKET/user/avatars//sub_small/FILENAME.png

Notice the lack of id between "avatars/" and "/sub_small" in the second url.

My model looks like this:

has_attached_file :avatar,
:default_url => "/assets/profile_pics/dummy_:style.jpg",
:styles => { :profile => "216x196#",
:track => "114x106#",
:track_mini => "40x38#",
:sub => "96x88#",
:sub_small => "71x65#"},
:storage => :s3,
:s3_credentials => "#{Rails.root}/config/s3.yml",
:path => "/user/:attachment/:id/:style/:basename.:extension",
:bucket => APP_CONFIG[:bucket],
:s3_host_alias => APP_CONFIG[:cdn],
:s3_host_name => "s3-eu-west-1.amazonaws.com",
:s3_headers => { 'Expires' => 1.year.from_now.httpdate }

I am running with Paperclip gem version: 2.5.0 and aws-sdk gem version: 1.2.6

Any suggestions on what might be causing this would be helpful thanks.