Connecting with GTalk with Jabber/XMPP

J

Jakub Groncki

Hello! I've got some problems with connecting to GTalk via xmpp4r lib.
I'm trying to run this code:

require 'rubygems'
require 'xmpp4r-simple'
include Jabber

jabber = Simple.new('(e-mail address removed)', 'password')

But ruby returns following error:


client.rb:3:in `require':
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.
8/lib/xmpp4r-simple.rb:441: syntax error, unexpected ':', expecting
keyword_then
or ',' or ';' or '\n' (SyntaxError)
when nil: new_presence.show || :eek:nline
^
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb:442
: syntax error, unexpected keyword_when, expecting keyword_end
when :unavailable: :unavailable
^
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb:443
: syntax error, unexpected keyword_else, expecting keyword_end
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb:490
: syntax error, unexpected keyword_end, expecting $end
from client.rb:3:in `<main>'

Really sorry for my bad English :( I don't know what's the matter. I was
looking for similar problems here, on forum and I 'googled' it but I
didn't receive any good results. Hope I'm understandable.
 
J

Jeremy Bopp

Hello! I've got some problems with connecting to GTalk via xmpp4r lib.
I'm trying to run this code:

require 'rubygems'
require 'xmpp4r-simple'
include Jabber

jabber = Simple.new('(e-mail address removed)', 'password')

But ruby returns following error:


client.rb:3:in `require':
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.
8/lib/xmpp4r-simple.rb:441: syntax error, unexpected ':', expecting
keyword_then
or ',' or ';' or '\n' (SyntaxError)
when nil: new_presence.show || :eek:nline
^
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb:442
: syntax error, unexpected keyword_when, expecting keyword_end
when :unavailable: :unavailable
^
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb:443
: syntax error, unexpected keyword_else, expecting keyword_end
C:/Ruby191/lib/ruby/gems/1.9.1/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb:490
: syntax error, unexpected keyword_end, expecting $end
from client.rb:3:in `<main>'

Really sorry for my bad English :( I don't know what's the matter. I was
looking for similar problems here, on forum and I 'googled' it but I
didn't receive any good results. Hope I'm understandable.

That gem is incompatible with Ruby 1.9 syntax, and you appear to be
attempting to use it under Ruby 1.9. The problem is that the when
keyword of the case statement no longer allows the use of a colon to end
the match expression. One must either use the then keyword or a newline
instead.

You should either contact the gem author and request an update, fork the
project and update it yourself, or use the gem under Ruby 1.8.7. Good
luck! :)

-Jeremy
 
J

Jakub Groncki

So I've got job for the weekend ;-) I'll try. Just one question: is
there any other gem which supports the Jabber protocol?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top