I'm trying to run the clean rake task for paperclip as I've just finished converting all the previous images which were png, into jpg and I keep getting
rake aborted!
Too many open files - convert
I'm sure I have over 10,000 images with 6 variations of styles, any ideas on how to get around this?
See if this answers your question: https://github.com/thoughtbot/paperclip/issues/862
From that thread,
Sikachu (https://github.com/sikachu) said:
"That means you aren't closing the file after assigning to Paperclip. You have to close the file after >assign it to the attachment, as Paperclip clones your file as a Tempfile right after the assignment. >We've done that to prevent undesired behavior (say, trying to rewind the file after you assign it to >Paperclip.)"
file = File.open("foo.jpg")
@user.attachment = file
file.close # totally safe!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With