samg / diffy

Easy Diffing in Ruby
http://rubygems.org/gems/diffy
MIT License
1.27k stars 104 forks source link

Errno:ENOENT in XP #27

Open arghorashy opened 11 years ago

arghorashy commented 11 years ago

I'm using ruby 1.9.3p327 (2012-11-10) [i386-mingw32] under Windows XP SP 3.

Here are the steps I followed:

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 <main>' from script_diff.rb:19:inblock (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 <main>' from script_diff.rb:22:inblock in cycleInDir' from script_diff.rb:11:in foreach' from script_diff.rb:11:incycleInDir' from scriptdiff.rb:30:in `

'

I'm not sure what I'm doing wrong, but any help here would be appreciated!

samg commented 11 years ago

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.

bwl21 commented 11 years ago

@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.

arghorashy commented 11 years ago

I placed diff and which in c:\unixutils (a path without spaces), changed my path and the errors went away.

Thanks, Grasswistle

bwl21 commented 11 years ago

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 ;-)