Warning: The Experiment

Ruby's Warning module learned some new tricks in Ruby 2.7:

Support for muting different categories of compile warnings has been introduced. This is a mechanism on top of the warning level reflected by the $VERBOSE variable.

You can now silence deprecation warnings: These are aspects of the language which will be removed or changed in a future version of Ruby. One example is the infamous: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

It is also possible to mute experimental features warnings: These are new features of Ruby, which might not have a stable API yet, like the new pattern matching

Per Ruby

Warning[:experimental] = false
Warning[:deprecated] = false


$ ruby -W:no-deprecated
$ ruby -W:no-experimental

Per ENV Variable

$ RUBYOPT="-W:no-deprecated" ruby
$ RUBYOPT="-W:no-experimental" ruby

Also See

More Idiosyncratic Ruby