public
Last active

Paperclip Override for Jruby 1.7.4 Windows Issue

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10
#place this overide in a rails initailizer as a workaround
 
module Paperclip
class ContentTypeDetector
def type_from_file_command
type = SENSIBLE_DEFAULT
type.split(/[:;\s]+/)[0]
end
end
end

From what I can gather, paperclip is runnning the "file" command to identify a file type.
Windows has no such "file" command. Unfortunatly, there is a Jruby 1.7.4 issue with the "current thread" variable which prevents the type_from_file_command from failing gracefully. Here is a work around

@hathawad have you confirmed this is fixed on master for 1.7.5 yet? We did change the logic of this so that we no longer have the current thread issue. I just want to make sure so we can make sure this is addressed for 1.7.5.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.