How do I get colour with Windows command prompt using RSpec in Ruby?

前端 未结 8 3016
迷失自我
迷失自我 2021-02-20 03:10

In other o/s RSpec returns nicely coloured results (red, green etc).

However in the windows (Vista) command prompt my text output is just plain old boring white.

8条回答
  •  南旧
    南旧 (楼主)
    2021-02-20 04:03

    I had this issue. I've been unable to get ansicon to work, as it crashes when running from cmd.

    To fix I added the Win32console gem to my gem file and then ran bundle update.

    **As an update: Put the gem in the test group of your gemfile:

        group :test do
          gem 'rails-controller-testing', '1.0.2'
          gem 'minitest-reporters',       '1.1.14'
          gem 'guard',                    '2.13.0'
          gem 'guard-minitest',           '2.4.4'
          gem 'win32console'
        end
    

    This will prevent errors when pushing to heroku

    Cheers!

提交回复
热议问题