I'm currently trying to learn Ruby on Rails on Windows 10 .
I'm following the excellent railstutorial by Michael Hartl .
However, I'm getting bugged by the 'gem install win32console' message (and lack of colour) appearing when I run rake test
. How can I fix this?
$ bundle exec rake test
ansi: 'gem install win32console' to use color on Windows
Started
3/3: [===================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.35885s
3 tests, 6 assertions, 0 failures, 0 errors, 0 skips
Base: Ruby 2.2 Rails Installer for Windows .
Running commands using Git Bash .
I also have the minitest-reporters gem installed ( step 3.7.1 of tutorial ).
First I ran gem install win32console
bu this had no effect, even though the gem is visible when I run gem list
.
Then I saw win32console is deprecated so I installed ansicon .
This also had no effect. And it seems colours are supported on Windows 10 anyway.
Eg I can run the Hello World example puts "\\e[34mHello \\e[31mWorld\\e[0m"
found on this blog and it shows blue and red text, whether ansicon is installed or not.
However, colours won't show up correctly in rake test
output and I still get the warning.
Hooray got it working!
In the end your comment Jordan plus the suggestions on Paul's Perambulations got me there.
gem install rake -v 10.4.2
gem install rake-compiler -v 0.9.9
(this is current latest anyway) gem install hoe -v 3.7.0
rake _10.4.2_ gem
in the win32console source directory (to use correct version) gem install pkg/win32console-1.3.2.gem
(had to change version number and flip the slash around from original instructions) gem "win32console", '1.3.2'
to Gemfile bundle install
bundle exec rake test
- the info message has disappeared and colours are showing correctly!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.