Connecting with GTalk with Jabber/XMPP

Discussion in 'Ruby' started by Jakub Groncki, Jan 2, 2011.

  1. 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 ='', 'password')

    But ruby returns following error:

    client.rb:3:in `require':
    8/lib/xmpp4r-simple.rb:441: syntax error, unexpected ':', expecting
    or ',' or ';' or '\n' (SyntaxError)
    when nil: || :eek:nline
    : syntax error, unexpected keyword_when, expecting keyword_end
    when :unavailable: :unavailable
    : syntax error, unexpected keyword_else, expecting keyword_end
    : 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.
    Jakub Groncki, Jan 2, 2011
    1. Advertisements

  2. Jakub Groncki

    Jeremy Bopp Guest

    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

    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 Bopp, Jan 2, 2011
    1. Advertisements

  3. So I've got job for the weekend ;-) I'll try. Just one question: is
    there any other gem which supports the Jabber protocol?
    Jakub Groncki, Jan 2, 2011
  4. Jakub Groncki

    sammcj Guest


    Did you ever get anywhere with this for ruby 1.9 / 2.x ?
    sammcj, May 3, 2014
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.