question

William Tang avatar image
William Tang asked William Tang edited

ruby websocket error: uninitialized constant WS

hi all, im following the tutorial here https://developers.ringcentral.com/guide/notifications/websockets/quick-start#ruby to create a ruby websocket. however, after running the code websockets.rb (i just copied and pasted the code from the tutorial page), i kept getting this error:

''websockets.rb:24:in `<main>': uninitialized constant WS (NameError)''

"subscription = WS.new($rc, events, lambda { |message|"

any idea why it's not recognizing WS? thanks

webhooks
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered

Please refer to https://github.com/ringcentral/ringcentral-ruby/blob/master/spec/websocket_subscription_spec.rb

I believe you need to "require 'subscription' "


Please create a support ticket if it still doesn't work: https://developers.ringcentral.com/support/create-case

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

William Tang avatar image
William Tang answered William Tang edited

hi, thanks. the code i used was exactly the same from this url, i didnt change anything, and it did have require'subscription' but the error is still happening: https://developers.ringcentral.com/guide/notifications/websockets/quick-start#ruby

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys