technoweenie / attachment_fu

Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.
http://weblog.techno-weenie.net
MIT License
1.02k stars 337 forks source link

TypeError (can't convert nil into Integer): #34

Open ilankasan opened 13 years ago

ilankasan commented 13 years ago

I followed a simple example to upload a file. When i add to the upload form the field <%= f.file_field :uploaded_data %>, and submit the form (with or without an image), i get an error message in the web page: 500 Internal Server Error

On the server log i get an error message:TypeError (can't convert nil into Integer):

I am on rails 3.0.5 and Ruby 1.9.2 on Windows 7

I used the sample code at:http://clarkware.com/blog/2007/02/24/file-upload-fu

bjorntrondsen commented 13 years ago

I had the same issue on Linux, however only when using Phusion Passenger, not Thin or Webrick. Jmoses seems to have a fix for this on his branch:

gem "attachment_fu", :git => "https://github.com/jmoses/attachment_fu.git", :branch => 'rails3'