title: Nodejs GM module ImageMagick - strange Error
body: <p>I have a very strange error. I'm using MAC OS X 10.9.5.
  When i use some functions from GM (<code>npm install gm</code>) like resize or something else i got this error.</p>
  
  <pre><code>    events.js:72
              throw er; // Unhandled 'error' event
            ^
      Error: spawn ENOENT
          at errnoException (child_process.js:988:11)
          at Process.ChildProcess._handle.onexit (child_process.js:779:34)
  </code></pre>
  
  <p>I have found many threads about it and according to them i have installed graphicksmagic and imagemagick with brew to system.</p>
  
  <pre><code>brew install imagemagick
  brew install graphicsmagick
  </code></pre>
  
  <p>It was working for a while but for no reason it starts to showing the above error again.</p>
  
  <p>I checked that i have installed imagemagick and graphicksmagick in system and its working from terminal.
  I checked if i have it in $PATH and its there.</p>
  
  <p>If i run this in nodejs it shows correct version of imagemagick in console, so i assume path is ok in nodejs.      </p>
  
  <pre><code>var sys = require('sys')    
  var exec = require('child_process').exec;
          function puts(error, stdout, stderr) {
                  if(error)
                          sys.puts(error);
                  if(stderr)
                          sys.puts(stderr);
                  sys.puts(stdout);
          }
  exec("identify --version", puts);
  </code></pre>
  
  <p>This is code which is crashing:</p>
  
  <pre><code>gm(request(url), thumbName)
                  .resize('300', '300', '^')
                  .gravity('Center')
                  .crop('300', '300')
                  .toBuffer('JPG',function (err, buffer) {
                      var data = {
                          Bucket: bucket,
                          Key: thumbName,
                          Body: buffer,
                          ACL:'public-read',
                          ContentType: 'image/jpeg'
                      };
                      s3.putObject(data, function(err, res) {
                         ....
                      });
  </code></pre>
  
  <p>Everything is working when i deploy it on heroku</p>