Can't get a simple ruby Example working for pubnub

305 views Asked by At
 require 'pubnub'

 pubnub = Pubnub.new(
        :publish_key => 'demo',
        :subscribe_key => 'demo'
    )

 pubnub.publish(
   :channel  => 'The Angular Channel',
   :message => 'Hello PubNub, love the Ruby SDK!',
 ) { |data| puts data.response }

I basically just followed the example from the SDK documentation page. I am not too sure what went wrong. as I try using the Angular Channel demo, I can successfully subscribe, but using this ruby script I can't seem to make it work.

the log is printed to the pubnub log.

Created new Pubnub::Client instance
D, [2015-06-14T16:54:05.940851 #33052] DEBUG -- pubnub: Event#initialize | Initialized Pubnub::Publish
D, [2015-06-14T16:54:05.940972 #33052] DEBUG -- pubnub: Pubnub::Publish#uri http://pubsub.pubnub.com/publish/demo/demo/0/The%20Angular%20Channel/0/%22Hello%20PubNub%2C%20love%20the%20Ruby%20SDK%21%22?pnsdk=PubNub-Ruby/3.7.1&uuid=065e1ab5-e87c-4fb2-a07d-b78bd8243610
I, [2015-06-14T16:54:05.941349 #33052]  INFO -- pubnub: Bytesize: 189
D, [2015-06-14T16:54:05.941445 #33052] DEBUG -- pubnub: Pubnub::Publish#uri http://pubsub.pubnub.com/publish/demo/demo/0/The%20Angular%20Channel/0/%22Hello%20PubNub%2C%20love%20the%20Ruby%20SDK%21%22?pnsdk=PubNub-Ruby/3.7.1&uuid=065e1ab5-e87c-4fb2-a07d-b78bd8243610
I, [2015-06-14T16:54:05.941521 #33052]  INFO -- pubnub: Length:   189
D, [2015-06-14T16:54:05.941546 #33052] DEBUG -- pubnub: Created event Pubnub::Publish
D, [2015-06-14T16:54:05.941566 #33052] DEBUG -- pubnub: Pubnub::SingleEvent#fire
D, [2015-06-14T16:54:05.941585 #33052] DEBUG -- pubnub: Pubnub::SingleEvent#fire | Adding event to async_events
D, [2015-06-14T16:54:05.941604 #33052] DEBUG -- pubnub: Pubnub::SingleEvent#fire | Starting railgun
D, [2015-06-14T16:54:05.941622 #33052] DEBUG -- pubnub: Pubnub::Client#start_event_machine | starting EM in new thread
D, [2015-06-14T16:54:05.941641 #33052] DEBUG -- pubnub: Pubnub::Client#start_event_machine | We aren't running on thin
D, [2015-06-14T16:54:05.948131 #33052] DEBUG -- pubnub: Pubnub::Client#start_event_machine | EM started in new thread
D, [2015-06-14T16:54:05.948225 #33052] DEBUG -- Pubnub: Pubnub::Client#start_railgun | Initializing railgun
D, [2015-06-14T16:58:22.993076 #33140] DEBUG -- pubnub: Symbolizing options keys
D, [2015-06-14T16:58:22.993217 #33140] DEBUG -- pubnub: Setting default values
D, [2015-06-14T16:58:22.993306 #33140] DEBUG -- pubnub: 
0

There are 0 answers