xmpp4r
xmpp4r copied to clipboard
Ruby 1.9 incompatability in client.rb, use of $defout
Ruby 1.9 removes (not just deprecates) the global variable $defout. There is a use of $defout in client.rb in auth_nonsasl:
$defout.flush
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.