You can clone with
There is a monkeypatch for Tempfile at the bottom of lib/paperclip/iostream.rb that breaks Tempfile#size when it is run from JRuby.
It looks likes this is due to a different Tempfile implementation in JRuby. The @tmpfile instance variable is never set, so Tempfile#size always returns 0.
Tested on Windows XP and Fedora (JRuby only) with Ruby 1.8.6 and JRuby 1.3.1
After removing the patch, the file size is reported properly ONLY after processing. If the files aren't processed - 0 is reported.
This might work for JRuby (iostream.rb):
if defined? Tempfile
Since paperclip's Tempfile monkeypatch is meant to fix a bug on Windows, it should just be patched on Windows:
if defined? Tempfile and /mswin|win32|mingw|bccwin|cygwin/ =~ RUBY_PLATFORM
Only monkey patch the Tempfile if it's not jRuby (RUBY_PLATFORM =~ /j…