bugXMPP4R - Bugs: bug #18456, Ruby 1.9 incompatability in...

Show feedback again

bug #18456: Ruby 1.9 incompatability in client.rb, use of $defout

Submitted by:  Jon Tara <jtara>
Submitted on:  Fri Aug 5 19:03:44 2011  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Fri Aug 5 19:03:44 2011, original submission:

Ruby 1.9 removes (not just deprecates) the global variable $defout. There is a use of $defout in client.rb in auth_nonsasl:


This flushes Ruby's default output stream.

Since $defout is undefined in Ruby 1.9x, the application will throw a NoMethodError, undefined method 'flush' for nil:NilClass.

It's not clear to me that this line is even necessary. I'm guessing it's there to flush the log, but since there's nothing like this anywhere else in XMPP4R... (I also searched for references to $>, $stdout, $stderr...)

Quick no-patch workaround is to simply define $defout in your application. I used:

$defout = $>

Not sure from the Ruby docs that this is quite equivalent, though.

Jon Tara <jtara>


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jtara (Submitted the item)
  • -unavailable- added by jtara

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Aug 5 19:03:44 2011jtaraCarbon-Copy-=>Added jtara
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup