title: Identify error Paperclip and Imagemagick
body: <p>I recently upgraded to osx 10.8 (Mtn Lion) and now I am having problems with Imagemagick. I get the following error when I try to upload a file:</p>
  
  <pre><code>Command :: identify -format %wx%h '/var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg[0]'
  [paperclip] An error was received while processing: #&lt;Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg is not recognized by the 'identify' command.&gt;
  Command :: identify -format %wx%h '/var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg[0]'
  [paperclip] An error was received while processing: #&lt;Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg is not recognized by the 'identify' command.&gt;
  </code></pre>
  
  <p>I uninstalled / reinstalled homebrew and imagemagick. I even added the rmagick gem (which I didn't need before) but still get the above error.</p>
  
  <pre><code>brew install imagemagick
  Error: imagemagick-6.7.7-6 already installed
  </code></pre>
  
  <p>Here is brew doctor output:</p>
  
  <pre><code>brew doctor
  Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
  You should probably unset it.
  Warning: You have uncommitted modifications to Homebrew's core.
  Unless you know what you are doing, you should run:
    cd /usr/local &amp;&amp; git reset --hard
  Warning: /usr/bin occurs before /usr/local/bin
  This means that system-provided programs will be used instead of those
  provided by Homebrew. The following tools exist at both paths:
  
  xml2-config
  xmlcatalog
  xmllint
  xslt-config
  xsltproc
  
  Consider amending your PATH so that /usr/local/bin
  occurs before /usr/bin in your PATH.
  </code></pre>
  
  <p>I even added the following to my config/environments/development.rb file</p>
  
  <pre><code> Paperclip.options[:command_path] = "/usr/local/bin"
  </code></pre>
  
  <p>I uninstalled Imagemagick again and reinstalled it. Now I get the following link errors.</p>
  
  <pre><code>==&gt; Installing imagemagick dependency: jpeg
  dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
  ==&gt; Downloading http://www.ijg.org/files/jpegsrc.v8d.tar.gz
  Already downloaded: /Library/Caches/Homebrew/jpeg-8d.tar.gz
  ==&gt; ./configure --prefix=/usr/local/Cellar/jpeg/8d
  ==&gt; make install
  Error: The linking step did not complete successfully
  The formula built, but is not symlinked into /usr/local
  You can try again using `brew link jpeg'
  ==&gt; Summary
  /usr/local/Cellar/jpeg/8d: 18 files, 1.3M, built in 16 seconds
  ==&gt; Installing imagemagick dependency: libtiff
  dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
  ==&gt; Downloading http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz
  Already downloaded: /Library/Caches/Homebrew/libtiff-4.0.2.tar.gz
  ==&gt; ./configure --prefix=/usr/local/Cellar/libtiff/4.0.2
  ==&gt; make install
  Error: The linking step did not complete successfully
  The formula built, but is not symlinked into /usr/local
  You can try again using `brew link libtiff'
  ==&gt; Summary
  /usr/local/Cellar/libtiff/4.0.2: 241 files, 3.6M, built in 24 seconds
  Error: You must `brew link jpeg' before little-cms can be installed
  </code></pre>
  
  <p>When I type brew link jpeg</p>
  
  <pre><code>Error: No such file or directory - /usr/local/Cellar/jpeg/8c
  </code></pre>
  
  <p>When I type brew link libtiff</p>
  
  <pre><code>Error: No such file or directory - /usr/local/Cellar/libtiff/3.9.5
  </code></pre>
  
  <p>So in summary the links are looking for older versions of jpeg (8c instead of 8d) and libtiff (3.9.5 instead of 4.0.2)</p>
  
  <p>Any ideas on how to fix this?</p>