在使用Rails 3,Ruby 1.9.2的Windows 7上运行自动测试时出错 [英] Error running autotest on Windows 7 with Rails 3, Ruby 1.9.2

查看:116
本文介绍了在使用Rails 3,Ruby 1.9.2的Windows 7上运行自动测试时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 7上安装和运行Rails 3和Ruby 1.9.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.

我的Gemfile中有以下宝石:

I have the following gems in my Gemfile:

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

但是当我运行bundle exec autotest时,我得到:

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.

所以某些路径的格式似乎出了问题,但是我不确定在哪里以及如何解决.我尝试在Cygwin下运行此程序,但无济于事.

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.

我还尝试使用ZenTest宝石代替autotestautotest-rails-pure宝石,并且成功了!但是,它没有检测到默认目录中的测试文件.因此,这似乎也没有多大用处.

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.

谁可以提供帮助?

推荐答案

哦,是的!我找到了解决方案!我在此设置中需要的宝石是:

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

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

ZenTest gem生成正确的命令行字符串(实际上只是在管道后面有"unit_diff -u",没有路径). autotest-rails-pure gem可以找到正确的测试集.

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.

这篇关于在使用Rails 3,Ruby 1.9.2的Windows 7上运行自动测试时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆