Closed justin808 closed 9 years ago
This is caused when both "rainbow" and "colorize" gems are used. Avoid using both as both monkey patch String, and colorize puts a private method on String called color
.
https://github.com/fazibear/colorize/blob/master/lib/colorize/instance_methods.rb
I would suggest that rainbow eventually use the refinements feature in 2.2.1.
Rainbow 2.0 doesn't monkey patch String by default. It can do that if you want it to be compatible with Rainbow 1.0, but that's not recommended anyway.
What would be needed to support refinements?
@sickill,
I don't know. This is easy to reproduce by creating a rails project with a Gemfile that contains rubocop and colorize, and then run rake rubocop
.
I solved the issue by switching to rainbow from colorize in my gemfile.
Maybe the bug is that RuboCop should not be doing the monkeypatching? But once it's done...
For some reason, gems that include rainbow, like RuboCop, are failing when used with Ruby 2.2.1. This might be a bug with Ruby's 2.2.x refinements feature.
UPDATE
Actually, I'm seeing this with Ruby 2.1.5. Researching.