title: model missing required attr_accessor for 'photo_file_name' when uploading with paperclip and S3 on heroku
body: <p>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.</p>
  
  <p>When I try to do an upload, the log shows:</p>
  
  <pre><code>Processing ItemsController#create (for 72.177.97.9 at 2010-08-26 16:35:14) [POST]  
    Parameters: {"commit"=&gt;"Create", "authenticity_token"=&gt;"0Hy3qvQBHE1gvFVaq32HMy2ZIopelV0BHbrSeHkO1Qw=", "item"=&gt;{"photo"=&gt;#&lt;File:/home/slugs/270862_4aa601b_4b6f/mnt/tmp/RackMultipart20100826-6286-1256pvc-0&gt;, "price"=&gt;"342", "name"=&gt;"a new item", "description"=&gt;"a new item", "sold"=&gt;"0"}}
  
  Paperclip::PaperclipError (Item model missing required attr_accessor for 'photo_file_name'):
  </code></pre>
  
  <p>I found one blog post that referenced this error, and it said to add this to my model:</p>
  
  <pre><code>attr_accessor :photo_file_name
  attr_accessor :photo_content_type
  attr_accessor :photo_file_size
  attr_accessor :photo_updated_at
  </code></pre>
  
  <p>That does indeed make the <strong>model missing required attr_accessor for 'photo_file_name'</strong> error go away, but it still doesn't work.  See <a href="https://stackoverflow.com/questions/3575812/no-route-matches-with-paperclip-and-s3-on-heroku">my other question</a> 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.</p>