2012-10-24 27 views
11

मैंने अभी पेपरक्लिप रेल प्लगइन से पेपरक्लिप मणि में स्विच किया है। परियोजना एक रेल 2.3 आवेदन है और मैं पेपरक्लिप 2.7.2 मणि ​​का उपयोग कर रहा हूँ।पेपरक्लिप फ़ाइल नहीं मिली त्रुटि

मैं निम्नलिखित अजीब त्रुटि हो रही है:

identify: unable to open image `file': No such file or directory @ error/blob.c/OpenBlob/2617. 
identify: no decode delegate for this image format `file' @ error/constitute.c/ReadImage/544. 

लगता पेपर क्लिप जैसी 'फ़ाइल' नामक एक फ़ाइल के लिए लग रही है, लेकिन मुझे यकीन है कि क्यों नहीं कर रहा हूँ। मैंने पहले से मौजूद किसी भी कोड को नहीं बदला है। यह काम करता था, मैंने जो कुछ किया वह एक नए संस्करण में अपग्रेड किया गया था और एक प्लगइन पर एक मणि का उपयोग किया गया था।

कोई भी विचार?

अद्यतन

यह पेपर क्लिप में एक बग जहां यह ठीक से आदेश की सामग्री पार्स नहीं करता हो। किसी कारण से फ़ाइल प्लेसहोल्डर:

def run(cmd, arguments = "", local_options = {}) 
    if options[:image_magick_path] 
    Paperclip.log("[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead") 
    end 
    command_path = options[:command_path] || options[:image_magick_path] 
    Cocaine::CommandLine.path = [Cocaine::CommandLine.path, command_path].flatten.compact.uniq 
    local_options = local_options.merge(:logger => logger) if logging? && (options[:log_command] || local_options[:log_command]) 

    Cocaine::CommandLine.new(cmd, arguments, local_options).run 
end 

और

# Uses ImageMagick to determing the dimensions of a file, passed in as either a 
# File or path. 
# NOTE: (race cond) Do not reassign the 'file' variable inside this method as it is likely to be 
# a Tempfile object, which would be eligible for file deletion when no longer referenced. 
def self.from_file file 
    file_path = file.respond_to?(:path) ? file.path : file 
    raise(Paperclip::NotIdentifiedByImageMagickError.new("Cannot find the geometry of a file with a blank name")) if file_path.blank? 
    geometry = begin 
       Paperclip.run("identify", "-format %wx%h :file", :file => "#{file_path}[0]") 
      rescue Cocaine::ExitStatusError 
       "" 
      rescue Cocaine::CommandNotFoundError => e 
       raise Paperclip::CommandNotFoundError.new("Could not run the `identify` command. Please install ImageMagick.") 
      end 
    parse(geometry) || 
    raise(NotIdentifiedByImageMagickError.new("#{file_path} is not recognized by the 'identify' command.")) 
end 

Paperclip.run आदेश को बदलने के लिए विफल रहता है: मैं खोजने के लिए पेपर क्लिप स्रोत में गहरी खोदा। मैं कमांडलाइन पर निम्नलिखित चलाकर इस सत्यापित:

identify :file 

बंदर हाथ पैदावार अन्य त्रुटियों जहां एक ऐसी ही बात होता है द्वारा प्रतिस्थापन पैच।

उत्तर

23

ठीक है, मैंने इसे हल करने में कामयाब रहे।

यह कोकीन के साथ एक समस्या थी। लगता है कि पेपरक्लिप कोकीन पर निर्भरता है जो केवल कहती है कि यह कोकियन> 0.02 होना चाहिए। कोकीन 0.4.2 का नवीनतम संस्करण (इस लेखन के समय) में एक नया एपीआई है जो पिछड़ा संगत नहीं है। आपको कोकीन 0.3.2 में डाउनग्रेड करना होगा।

सीधे शब्दों में पेपरक्लिप से पहले अपने Gemfile में रखते:

gem "cocaine", "0.3.2" 
+2

यार, तुम दिन मेरे लिए बल्कि अपने gemfile में कोकीन को निर्दिष्ट से बचाया :) – emilsw

+7

, आप 2.7.4 करने के लिए अपने पेपरक्लिप संस्करण टक्कर ठीक करने के लिए कर सकते हैं यह भी। – Peter

+0

शानदार दोस्त ,! :) – user566245

संबंधित मुद्दे