JRuby / PaperClip

Hello fellow developer stuck with JRuby, Paperclip file size = 0 issue 🙂

Apparently the Paperclip workaround to report the proper file size doesn’t work with the current implementation of JRuby (Windows XP).

This “might” work (not thoroughly tested): iostream.rb

1234567891011if defined? Tempfile  class Tempfile    def size        if self.path          File.size(self.path)        else          0        end     end   endend

The issue is reported on github with other suggested fixes

This helped me today, almost a year later!
The issue is still around.