Skip to content

Instantly share code, notes, and snippets.

@gmarik
Created November 21, 2011 15:36
Show Gist options
  • Save gmarik/1382974 to your computer and use it in GitHub Desktop.
Save gmarik/1382974 to your computer and use it in GitHub Desktop.
Disable Gem deprecation spam

How to disable Gem deprecation warnings

Just copy content to corresponding files

if [ -d "$HOME/.ruby/lib/" ]; then
RUBYLIB="$RUBYLIB:$HOME/.ruby/lib"
RUBYOPT="-rno_deprecation_warnings_kthxbye"
export RUBYLIB RUBYOPT
fi

How to disable Gem deprecation warnings

Just copy content to corresponding files

# .ruby/lib/no_deprecation_warnings_kthxbye.rb
begin
require 'rubygems'
Gem::Deprecate.skip = true if defined?(Gem::Deprecate)
rescue LoadError => e
p e
end
@gmarik
Copy link
Author

gmarik commented Jul 9, 2020

Hey, were you looking for ruby or gem deprecation warnings? This ones are for gem, and probably irrelevant nowdays.
For ruby you need

$ RUBYOPT=-W0 ruby script.rb

to disable warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment