I have installed Ramaze (on Windows XP) and it suggested I also install win32console to get coloured log output when it is running.
However, after doing so I get escape codes rather than colours as shown below:
W [2009-04-29 09:02:55 $5064] WARN | : ←[33mNo explicit root folder found, assuming it is C:/Projects/Ruby/Ramaze/Conferences←[0m
D [2009-04-29 09:02:55 $5064] DEBUG | : ←[34mUsing webrick←[0m
I [2009-04-29 09:02:55 $5064] INFO | : ←[37mWEBrick 1.3.1←[0m
I [2009-04-29 09:02:55 $5064] INFO | : ←[37mruby 1.8.6 (2008-08-11) [i386-mswin32]←[0m
D [2009-04-29 09:02:55 $5064] DEBUG | : ←[34mTCPServer.new(0.0.0.0, 7000)←[0m
D [2009-04-29 09:02:55 $5064] DEBUG | : ←[34mRack::Handler::WEBrick is mounted on /.←[0m
I [2009-04-29 09:02:55 $5064] INFO | : ←[37mWEBrick::HTTPServer#start: pid=5064 port=7000←[0m
This happens even on a clean install of Ruby/Ramaze/win32console
My setup is:
- Windows XP with SP#3
- ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
- rubygems version 1.3.1
- win32console gem version 1.2.0
Incidentally, the following test program seems to work so I am wondering if it is a Ramaze/win32console issue on my machine.
#!/usr/bin/ruby
require 'rubygems'
require 'win32console'
[0, 1, 4, 5, 7].each do |attr|
puts '----------------------------------------------------------------'
puts "ESC[#{attr};Foreground;Background"
30.upto(37) do |fg|
40.upto(47) do |bg|
print "\033[#{attr};#{fg};#{bg}m #{fg};#{bg} "
end
puts "\033[0m"
end
end