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

  1. Require the pubnub gem.
  2. Print the version with Pubnub::VERSION.
  3. Optionally initialize the SDK and log the configuration.
require 'pubnub'

def main
# Display the PubNub Ruby SDK version
puts "PubNub Ruby SDK Version: #{Pubnub::VERSION}"

# Optional: Initialize PubNub with the current version
pubnub = Pubnub.new(
subscribe_key: ENV.fetch('SUBSCRIBE_KEY', 'demo'), # Replace 'demo' with your Subscribe Key from the PubNub Admin Portal
publish_key: ENV.fetch('PUBLISH_KEY', 'demo'), # Replace 'demo' with your Publish Key from the PubNub Admin Portal
user_id: 'ruby-version-demo-user'
)

# Display configuration with version information
puts "\nPubNub Client Information:"
show all 39 lines
Last updated on