我目前正在尝试在Windows 10上学习 Ruby on Rails 。
我正在关注Michael Hartl 的优秀 railstutorial。
但是,当我运行rake test
. 我怎样才能解决这个问题?
样本输出:
$ 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
我的设置:
基础:适用于 Windows 的 Ruby 2.2 Rails 安装程序。使用Git Bash
运行命令。
我还安装了minitest-reporters gem(教程的步骤 3.7.1)。
我试过的:
首先我运行
gem install win32console
bu 这没有任何效果,即使我运行时 gem 是可见的gem list
。然后我看到win32console 已被弃用,所以我安装了ansicon。
这也没有效果。无论如何,Windows 10 似乎都支持颜色。
例如,我可以运行此博客上的Hello World示例,无论是否安装了 ansicon,它都会显示蓝色和红色文本。 但是,颜色不会在输出中正确显示,我仍然收到警告。puts "\e[34mHello \e[31mWorld\e[0m"
rake test