Selectively silence JRuby warnings
问题 I'm using the ruby-mysql library under JRuby and get the following warnings: /mysql/protocol.rb:530 warning: GC.disable does nothing on JRuby Is there any way to get JRuby to stop complaining about this? 回答1: You have a couple options. First, you can run your program with the -W0 option which will disable all warnings. That's probably not what you want. However, applying -W0 is the same as setting $VERBOSE to nil -- so we can simply do that around the code where we want to suppress warnings.