Error running autotest on Windows 7 with Rails 3, Ruby 1.9.2

走远了吗. 提交于 2019-12-24 04:06:15

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/4030844/error-running-autotest-on-windows-7-with-rails-3-ruby-1-9-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!