-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Possible issue with calling .color #1839
Comments
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 https://github.com/fazibear/colorize/blob/master/lib/colorize/instance_methods.rb |
According to ku1ik/rainbow#25 (comment), the Rainbow gem does not automatically monkey patch string. Reopening this issue in case this would be a nice enhancement for Rubocop. |
So, your project is using colorize and this is somehow conflicting with rainbow, right? I'll have to check the code, but I think we dropped the monkey patching when we adopted rainbow 2. |
@bbatsov We switched to avoid the issue, but it's a serious yak shaver for those that are not expecting it! I'm 100% the monkey patching is being done. I could also be that colorize is doing the monkey patching, and RuboCop is crashing due that. |
[Fix #1839] Remove Rainbow string monkey patching
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.
The text was updated successfully, but these errors were encountered: