views:

43

answers:

1

Setting up paperclip with S3 in my linux dev environment was a snap -- everything works out of the box. However, I can't get it to work on Heroku.

When I try to do an upload, the log shows:

Processing ItemsController#create (for 72.177.97.9 at 2010-08-26 16:35:14) [POST]  
  Parameters: {"commit"=>"Create", "authenticity_token"=>"0Hy3qvQBHE1gvFVaq32HMy2ZIopelV0BHbrSeHkO1Qw=", "item"=>{"photo"=>#<File:/home/slugs/270862_4aa601b_4b6f/mnt/tmp/RackMultipart20100826-6286-1256pvc-0>, "price"=>"342", "name"=>"a new item", "description"=>"a new item", "sold"=>"0"}}

Paperclip::PaperclipError (Item model missing required attr_accessor for 'photo_file_name'):

I found one blog post that referenced this error, and it said to add this to my model:

attr_accessor :photo_file_name
attr_accessor :photo_content_type
attr_accessor :photo_file_size
attr_accessor :photo_updated_at

That does indeed make the model missing required attr_accessor for 'photo_file_name' error go away, but it still doesn't work. See my other question for details. As I have figured out that with the attr_accessor lines added to my model the uploads fail even on my dev system, I suspect that is not the right answer.

A: 

Found the problem: needed to update the database.

heroku rake:db:migrate heroku restart

I had done what I thought would have accomplished the same thing already: heroku rake db:schema:load, but perhaps that doesn't work or something went wrong in the process.

eksatx