Troubleshooting Ruby SDK
This page explains how to identify your SDK version in the PubNub Ruby Software Development Kit (SDK).
How to find the version of your SDK
The version is contained in the VERSION constant in the Pubnub module.
Steps to access the SDK version
- Require the
pubnubgem. - Print the version with
Pubnub::VERSION. - Optionally initialize the SDK and log the configuration.
1require 'pubnub'
2
3def main
4 # Display the PubNub Ruby SDK version
5 puts "PubNub Ruby SDK Version: #{Pubnub::VERSION}"
6
7 # Optional: Initialize PubNub with the current version
8 pubnub = Pubnub.new(
9 subscribe_key: ENV.fetch('SUBSCRIBE_KEY', 'demo'), # Replace 'demo' with your Subscribe Key from the PubNub Admin Portal
10 publish_key: ENV.fetch('PUBLISH_KEY', 'demo'), # Replace 'demo' with your Publish Key from the PubNub Admin Portal
11 user_id: 'ruby-version-demo-user'
12 )
13
14 # Display configuration with version information
15 puts "\nPubNub Client Information:"
show all 39 lines