Help with Paperclip and ImageMagick on windows


I am hoping someone has run into this issue and can help!!!

I am running into an issue and been struggling for a couple of days. Hoping you can point me in the right direction :slight_smile:

I am developing on Windows Vista in Eclipse.

I am using Paperclip to add documents as attachments and create thumbnails. I have ImageMagick installed. The attachments are uploading no problem however when I try to create thumbnails I get the following error:

I have edited the command path in paperclip.rb to:

# :image_magick_path => nil,

        :command_path => "C:\Program Files\ImageMagick-6.6.2- Q16",

I have also added the following line in environments/development.rb

Paperclip.options[:command_path] = "C:\Program Files \ImageMagick-6.6.2- Q16"

The model looks like:

class Collection < ActiveRecord::Base

  belongs_to :user

  validates_presence_of :name, :on => :create, :message => "can't be blank"

  validates_presence_of :description, :on => :create, :message => "can't be blank"

  # Paperclip   has_attached_file :work,

                    :styles => { :thumb=> "100x100#",

                                  :small => "150x150>",

                                  :medium => "300x300>",

                                  :large => "400x400>" }

  validates_attachment_presence :work

  validates_attachment_content_type :work,

                                    :content_type => ['image/jpeg',






                                                       'application/ msword',

                                                       'application/ pdf',

                                                       'application/ octet-stream',

                                                       'audio/x-ms- wma',

                                                       'application/x- shockwave-flash',





The upload of documents works fine if I comment out the styles action.

When I try to create thumbnails with the styles action I get the followign browser error:

undefined method `exitstatus' for nil:NilClass

and I see the followign in the trace log:

Processing CollectionsController#new (for at 2010-06-29 10:21:33) [GET]   e[4;35;1mCollection Columns (13.0ms)e[0m e[0mSHOW FIELDS FROM `collections`e[0m Rendering template within layouts/collections Rendering collections/ new Rendered collections/_form (2.0ms) Completed in 64ms (View: 26, DB: 13) | 200 OK [ collections/new] -e: No such file or directory - /usr/local/bin/identify '-format' '%wx %h' 'C:/Users/SHAJIZ~1/AppData/Local/Temp/stream,3792,0.jpg[0]' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/ templates/rescues/_trace.erb:23: warning: parenthesize argument(s) for future version ions/new]   e[4;36;1mSQL (1.0ms)e[0m e[0;1mSET NAMES 'utf8'e[0m   e[4;35;1mSQL (1.0ms)e[0m e[0mSET SQL_AUTO_IS_NULL=0e[0m

Processing CollectionsController#create (for at 2010-06-29 10:21:52) [POST]   Parameters: {"collection"=>{"name"=>"dffdsfdsf", "description"=>"dfdsfsdf", "work"=>#<File:C:/Users/SHAJIZ~1/AppData/ Local/Temp/RackMultipart.3792.1>}, "commit"=>"Create", "authenticity_token"=>"2CuhAXmdMu+kx5TJn/fyBm/Z4IOf1CmTnXHXlF0rRu8="}   e[4;36;1mCollection Columns (49.0ms)e[0m e[0;1mSHOW FIELDS FROM `collections`e[0m [paperclip] /usr/local/bin/identify '-format' '%wx%h' 'C:/Users/ SHAJIZ~1/AppData/Local/Temp/stream,3792,0.jpg[0]'

NoMethodError (undefined method `exitstatus' for nil:NilClass):   app/controllers/collections_controller.rb:43:in `new'   app/controllers/collections_controller.rb:43:in `create'   C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'   C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'   C:/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'   -e:2:in `load'   -e:2

I suspect that although I have defined the windows path to ImageMacick paperclip is still trying to look for the ImageMighc Identify binary in the unix directory structure : /usr/loacl/bin. Hence the error:

No such file or directory - /usr/local/bin/identify '-format'

Any suggestion will help greatly... I have been strugling with this for a few days now... Thanks

This is not the place to discuss Paperclip issues. Please post to Paperclip google groups mailing list. This is Rails-core ML to discuss issues and ideas around Rails core development.