views:

28

answers:

2

Installing and running Rails 3 and Ruby 1.9.2 on Windows 7 went rather smooth. It's only now that I want to run autotest that I'm running into problems. The error looks frustratingly simple, but I can't figure out how to solve it.

I have the following gems in my Gemfile:

gem 'autotest'
gem 'autotest-rails-pure'

But then when I run bundle exec autotest, I get:

loading autotest/rails
style: Rails
C:\bin\Ruby192\bin\ruby -I.;lib;test -rubygems -e "['test/unit', 
'test/unit/helpers/users_helper_test.rb', 'test/unit/user_test.rb'].each 
{ |f| require f }" | C:/bin/Ruby192/lib/ruby/gems/1.9.1/gems/autotest-4.4.1/bin/unit_diff -u
'C:' is not recognized as an internal or external command, 
operable program or batch file.

So something seems to go wrong in the formatting of some path, but I'm not sure where and how to solve it. I've tried running this under Cygwin, but to no avail.

I have also tried using the ZenTest gem instead of the autotest and autotest-rails-pure gems and that ran! However, it did not detect any if the test files in the default directories. So that seems to be of not much use either.

Who can help?

A: 

I think this has to do with the way the Windows command shell interprets path names. Normally you can substitute "/" for "\" and it still works, but apparently not when you also use pipes. I'll bet if you can put quotes around the failing command (starting with C:/bin/Ruby192/...) Windows will recognize it as a string.

zetetic
Yeah, I thought it'd be something along those lines, but I have not found a working solution. I tried replacing the "/" with "\" in "C:/bin/..." after the pipe, but that just calls out the whole string ('C:\bin\...\unit_diff') to be not recognized. When I put the whole string within double quotes, it says the '"C:/bin/.../unit_diff"' is not recognized (note the double quotes within the single ones). The latter does make sense, since unit_diff is a ruby program and not a native Windows program. So the whole string that's being built does not look too good for Windows. Any other ideas?
Pascal Lindelauf
+1  A: 

Oh, yes! I found the solution! The gems I need in this setup are:

gem 'ZenTest'
gem 'autotest-rails-pure'

The ZenTest gem generates the correct command line string (which actually just has the "unit_diff -u" behind the pipe, without the path). The autotest-rails-pure gem finds the correct test set.

Pascal Lindelauf