diffy
diffy copied to clipboard
Errno:ENOENT in XP
I'm using ruby 1.9.3p327 (2012-11-10) [i386-mingw32] under Windows XP SP 3.
Here are the steps I followed:
- Downloaded DiffUtils 2.8.7 (Setup) and Which 2.20 (Setup) from http://gnuwin32.sourceforge.net/packages.html.
- Ran both exe's to install.
- Added _C:\Program Files\GnuWin32\bin_ to my path.
- Ensured that
which diff
worked. Output: C:\Program Files\GnuWin32\bin\diff.EXE - Downloaded diffy 2.1.2 gem from http://rubygems.org/gems/diffy/versions/2.1.2.
- Moved it to C:\Ruby193\bin, cd'd to that dir and successfully ran
gem install diffy 2.1.2
.
After all that, I tried using the following command in a script: puts Diffy::Diff.new(item, item2, :context => 5), where item and item2 are strings containing relative file paths (e.g., "./path to /file"). Unfortunately, I get the following error:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/diffy-2.1.2/lib/diffy/diff.rb:52:in ``': No
such file or directory - C:\Program Files\GnuWin32\bin\diff.exe -U 5 D:/DOCUME~1
/t0148524/LOCALS~1/Temp/diffy20131018-3216-9e9xgo D:/DOCUME~1/t0148524/LOCALS~1/
Temp/diffy20131018-3216-1l2fpzz (Errno::ENOENT)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/diffy-2.1.2/lib/diffy/diff.rb:5
2:indiff' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/diffy-2.1.2/lib/diffy/diff.rb:6 9:in
each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/diffy-2.1.2/lib/diffy/format.rb
:23:into_a' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/diffy-2.1.2/lib/diffy/format.rb :23:in
text'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/diffy-2.1.2/lib/diffy/diff.rb:1
17:into_s' from script_diff.rb:44:in
puts'
from script_diff.rb:44:inputs' from script_diff.rb:44:in
block (2 levels) in block (2 levels) in cycleInDir' from script_diff.rb:19:in
block (2 levels) in cycleInDir'
from script_diff.rb:22:inblock in cycleInDir' from script_diff.rb:11:in
foreach'
from script_diff.rb:11:incycleInDir' from script_diff.rb:19:in
block in cycleInDir'
from script_diff.rb:11:inforeach' from script_diff.rb:11:in
cycleInDir'
from script_diff.rb:19:inblock in cycleInDir' from script_diff.rb:11:in
foreach'
from script_diff.rb:11:incycleInDir' from script_diff.rb:31:in
block in block in cycleInDir' from script_diff.rb:11:in
foreach'
from script_diff.rb:11:incycleInDir' from script_diff.rb:30:in
I'm not sure what I'm doing wrong, but any help here would be appreciated!
I don't actually have access to an XP box so I probably can't help troubleshoot this. @bwl21 added the windows support in https://github.com/samg/diffy/pull/16 so he may have some advice on how to make it work. I believe that there's significantly more work getting diffy to work on windows since diff
isn't a standard utility (diffy should basically work out of the box on *nix).
If you find ways to make it easier feel free to submit a pull request.
@arghorashy: could you please try putting the diff.exe and which.exe on a path without spaces?
In my installation it is on a path without spaces. If it solves the problem, I will look into it (later ... sorry)
otherweise, could you please provide me with a test case.
I placed diff and which in c:\unixutils (a path without spaces), changed my path and the errors went away.
Thanks, Grasswistle
It should not be closed. I should change it such that it also works with spaces in the path (even if I feel that spaces in the path is a real evil and spaces in default paths is simply stupid (thanks Micorsoft - and Apple ;-)