# Suppress ruby warnings during runtime?

**URL:** <https://www.ruby-forum.com/t/suppress-ruby-warnings-during-runtime/112878>\
**Category:** Ruby\
**Created:** [August 24, 2007, 2:22am UTC](https://www.ruby-forum.com/t/suppress-ruby-warnings-during-runtime/112878 "2007-08-24T02:22:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [August 24, 2007, 2:22am UTC](https://www.ruby-forum.com/t/suppress-ruby-warnings-during-runtime/112878/1 "2007-08-24T02:22:28Z")

</div>

I’ve been looking for a way to supress warnings at runtime, not just in  
the shebang line… I’ve tride setting $VERBOSE = nil but that doesn’t  
seem to work right. Specifically i’m getting warnings when accessing  
Object#id, saying it’s deprecated… is there a way to turn off just  
deprecated warnings?

Thanks

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [August 24, 2007, 3:28am UTC](https://www.ruby-forum.com/t/suppress-ruby-warnings-during-runtime/112878/2 "2007-08-24T03:28:26Z")

</div>

On Aug 23, 2007, at 17:22, Aaron S. wrote:

> I’ve been looking for a way to supress warnings at runtime, not  
> just in  
> the shebang line… I’ve tride setting $VERBOSE = nil but that doesn’t  
> seem to work right. Specifically i’m getting warnings when accessing  
> Object#id, saying it’s deprecated… is there a way to turn off just  
> deprecated warnings?

Change calls from .id to .object\_id to turn off this warning.

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [August 24, 2007, 3:33am UTC](https://www.ruby-forum.com/t/suppress-ruby-warnings-during-runtime/112878/3 "2007-08-24T03:33:27Z")

</div>

Hi,

At Fri, 24 Aug 2007 09:22:37 +0900,  
Aaron S. wrote in [ruby-talk:266024]:

> I’ve been looking for a way to supress warnings at runtime, not just in  
> the shebang line… I’ve tride setting $VERBOSE = nil but that doesn’t  
> seem to work right. Specifically i’m getting warnings when accessing  
> Object#id, saying it’s deprecated… is there a way to turn off just  
> deprecated warnings?

Setting $VERBOSE = nil.

$ ruby -v -e id  
ruby 1.8.6 (2007-08-21 revision 13127) [i686-linux]  
-e:1: warning: Object#id will be deprecated; use Object#object\_id

$ ruby -v -e ‘$VERBOSE=nil;id’  
ruby 1.8.6 (2007-08-21 revision 13127) [i686-linux]

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [August 27, 2007, 12:45am UTC](https://www.ruby-forum.com/t/suppress-ruby-warnings-during-runtime/112878/4 "2007-08-27T00:45:24Z")

</div>

Eric H. schrieb:

> On Aug 23, 2007, at 17:22, Aaron S. wrote:
> 
> > I’ve been looking for a way to supress warnings at runtime, not just in  
> > the shebang line… I’ve tride setting $VERBOSE = nil but that doesn’t  
> > seem to work right. Specifically i’m getting warnings when accessing  
> > Object#id, saying it’s deprecated… is there a way to turn off just  
> > deprecated warnings?
> 
> Change calls from .id to .object\_id to turn off this warning.  
> This sounds like rails.1  
> And the ID of a model is model.id. So you can’t change id to object\_id.
