spree/spree — Issue #1218: undefine method 'attachment_sizes for Image' on heroku
Author: deepaktyagi3i36
Created: 2012-03-02 16:12:40+00:00
State: open

hello i new to spree, i deploy my first spree project to heroku. my site working fine in local but on heroku when i want to upload product image then i get the following error 'undefine method attachment_sizes for class <#Image xxxxx45545545 >'

please help me.

and please tell me how i use my existing database images on heroku.and please tell me how i setup AWS-S3 setup on heroku by gem.

i did not understand 'SpreeHeroku' which is in many gems model (when if condition true in this case).

class PageImage < Image

if defined?(SpreeHeroku)
has_attached_file :attachment,
:styles => Proc.new{ |clip| clip.instance.attachment_sizes },
:default_style => :medium,
:path => "assets/pages/:id/:style/:basename.:extension",
:storage => "s3",
:s3_credentials => "#{Rails.root}/config/s3.yml"
else
has_attached_file :attachment,
:styles => Proc.new{ |clip| clip.instance.attachment_sizes },
:default_style => :medium,
:url => "/assets/pages/:id/:style/:basename.:extension",
:path => ":rails_root/public/assets/pages/:id/:style/:basename.:extension"
end
end

Please help me. I spend my last 5 days on this issue but i did't able to solve it.

Thank you very much.