You can clone with
Because windows doesn't have the file command, so this line Paperclip.run("file", "-b --mime :file", :file => self.path).split(/[:;\s]+/) raises error.
can't be shown?
This was fixed in 1d22cdc. Thanks for reporting in.
(I've posted this as a comment to the commit, but perhaps here is a better place) :
Hi, I'm running windows 7 and getting undefined method `match' for nil:NilClass
Yep, still getting undefined method `match' for nil:NilClass after "file -b --mime ..." w/ Paperclip v3.1.4 on Windows 7.
paperclip (3.1.4) lib/paperclip/content_type_detector.rb:60:in type_from_file_command'
paperclip (3.1.4) lib/paperclip/content_type_detector.rb:16:indetect'
paperclip (3.1.4) lib/paperclip/io_adapters/file_adapter.rb:14:in cache_current_values'
paperclip (3.1.4) lib/paperclip/io_adapters/file_adapter.rb:5:ininitialize'
paperclip (3.1.4) lib/paperclip/io_adapters/registry.rb:29:in new'
paperclip (3.1.4) lib/paperclip/io_adapters/registry.rb:29:infor'
paperclip (3.1.4) lib/paperclip/attachment.rb:412:in post_process_style'
paperclip (3.1.4) lib/paperclip/attachment.rb:402:inblock in post_process_styles'
paperclip (3.1.4) lib/paperclip/attachment.rb:401:in each'
paperclip (3.1.4) lib/paperclip/attachment.rb:401:inpost_process_styles'
paperclip (3.1.4) lib/paperclip/attachment.rb:394:in `block (2 levels) in post_process'
paperclip (3.1.4) lib/paperclip/content_type_detector.rb:16:in
paperclip (3.1.4) lib/paperclip/io_adapters/file_adapter.rb:5:in
paperclip (3.1.4) lib/paperclip/io_adapters/registry.rb:29:in
paperclip (3.1.4) lib/paperclip/attachment.rb:402:in
paperclip (3.1.4) lib/paperclip/attachment.rb:401:in
Thanks for reopening the issue, @sikachu.
For now I've just installed File package from GnuWin32 (http://gnuwin32.sourceforge.net/packages/file.htm) and it solved the problem. I also had to add C:\Program Files\GnuWin32\bin to PATH and reboot. For me it was not a big deal since my production environment is Linux-based, but I understand this might not be considered a definitive solution for some people.
At least now we know for sure that the issue is actually related to the file command in type_from_file_command (content_type_detector.rb, line 54) on Windows. This is still strange though since the method was not supposed to be executed at all. I ran MIME::Types.type_for(@filename) in the console and it returned a non-null array as expected, so match? (line 38) should return true and the detect method (line 10) should bypass the call for type_from_file_command. It seems that MIME::Types.type_for(@filename) is returning nil when performed by paperclip instead.
My system specs:
I hope this helps.
Submitted pull request for fix
The fix for this was pulled into master not too long ago. If anyone has recurring problems from here, please open a new ticket on the issue so we can start fresh. Thanks.