Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32console deprecated (windows) #36

Open
erasmux opened this issue Sep 28, 2016 · 0 comments
Open

win32console deprecated (windows) #36

erasmux opened this issue Sep 28, 2016 · 0 comments

Comments

@erasmux
Copy link

erasmux commented Sep 28, 2016

First the issue, even with win32console I can't get colors on windows:

irb(main):001:0> require 'ansi/code'
ansi: 'gem install win32console' to use color on Windows

The reason is that win32console is deprecated (and does not load on recent ruby versions). The good news is that, to the best of the my knowledge, it is no longer needed in ruby 2.0+.

The fix is very simple: don't require 'win32console' when ruby version is 2.0+ (assuming I am not missing anything here).

I verified this by changing code.rb, line 9 to:
if RUBY_PLATFORM =~ /(win32|w32)/ && RUBY_VERSION < "2.0"
This seems to work fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant