Question

I'm running:
+ Ruby 1.9.2p290
+ Rails 3.1.1
+ Rspec 2.6.0
+ autotest 4.4.6
+ ansicon 1.40
+ spork
+ growl
on Windows Vista 64-bit to go through the rails 3 tutorial. The tests seem to run fine and I get the expected output--except coloring. The output from autotest is in color. If I run rspec alone as rspec spec/ I get escape sequences printed rather than color. Other rails tools also vary on whether they display in color or escape sequences. Any suggestions?

Était-ce utile?

La solution

After rechecking everything and lots more research, I could find nothing that should keep ansicon from trapping the color sequences. The only requirement on ansicon is that it be located in PATH. I'd placed it in c:\windows\system32 since that is always in PATH, however, it is about 10 items down the list. One thought is that some Rails apps are not searching that far. I copied the ansicon files to C:\RailsInstaller\Ruby1.9.2\bin that is at the top of PATH, and now it works all the time.

I suspect that some Rails apps have trouble with items in PATH, possibly spaces in the pathnames (such as "Program Files") or other such differences between Linux and Windows that sometimes choke programs.

Autres conseils

Most Ruby tools have problems with spaces in PATH. Therefore, try putting ansicon at the front of the entire PATH before everything else -- especially those with C:\Program Files\....

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top