0
I am running a Ruby on Rails application - inside the app there is a Ruby Gem I've loaded which determines the location of an executable file called pngcrush
. The way it does this is that it runs the command which pngcrush
, which returns /cygdrive/c/Windows/system32/pngcrush
. However when the gem tries to issue the command using a system call `/cygdrive/c/Windows/system32/pngcrush somefile.jpg newfile.jpg`
it fails. It seems that it can FIND the file but not execute it, perhaps because it's being executed within cmd
and not bash
.
i.e., Within cmd
I type: /cygdrive/c/Windows/system32/pngcrush
and I get The system cannot find the path specified
. When in cmd
I type bash
, then within bash I type the same thing, it works. I cannot modify the Gem as it's authored by someone else.
how about
c:\Windows\system32\pngcrush somefile.jpg newfile.jpg
? Also in cygwin try to CD into the directory and then do ls and see it's there then do./pngcrush somefile.jpg newfile.jpg
– barlop – 2014-09-03T19:42:42.703also include a screenshot and try not to mix cygwin syntax with cmd syntax. e.g. cmd uses \ cygwin uses /. cygwin uses /cygdrive/c cmd uses c:\ And try going into the directory with CD first. Then just running
c:\windows\system32>pngcrush a.jpg b.jpg
– barlop – 2014-09-03T19:44:55.543