Note that there are some explanatory texts on larger screens.

plurals
  1. POPaperclip File Not Found Error
    primarykey
    data
    text
    <p>I just switched from a paperclip rails plugin to a paperclip gem. The project is a rails 2.3 application and I am using paperclip 2.7.2 gem.</p> <p>I am getting the following odd error:</p> <pre><code>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. </code></pre> <p>Seems like paperclip is looking for a file called 'file' but I am not sure why. I didn't change any of the code we had before. It used to work, all I did was upgrade to a newer version and use a gem over a plugin.</p> <p>Any ideas?</p> <p><em><strong>Update</em></strong></p> <p>It to be a bug in paper clip where it does not parse the content of the command properly. I dug deep into the paperclip source to find:</p> <pre><code>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 =&gt; logger) if logging? &amp;&amp; (options[:log_command] || local_options[:log_command]) Cocaine::CommandLine.new(cmd, arguments, local_options).run end </code></pre> <p>and</p> <pre><code># 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 =&gt; "#{file_path}[0]") rescue Cocaine::ExitStatusError "" rescue Cocaine::CommandNotFoundError =&gt; 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 </code></pre> <p>The Paperclip.run command fails to replace the :file placeholder for some reason. I verified this by running the following on the commandline:</p> <pre><code>identify :file </code></pre> <p>Monkey patching the replacement by hand yields other errors where a similar thing happens.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload