---
source_url: https://www.pubnub.com/docs/sdks/ruby/troubleshoot
title: Troubleshooting Ruby SDK
updated_at: 2026-05-25T11:29:17.096Z
sdk_name: PubNub Ruby SDK
sdk_version: 6.0.2
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Troubleshooting Ruby SDK

PubNub Ruby SDK, use the latest version: 6.0.2

Install:

```bash
gem install pubnub@6.0.2
```

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.

```ruby
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:"
  puts "- SDK Version: #{Pubnub::VERSION}"
  puts "- User ID: #{pubnub.user_id}"
  puts "- Subscribe Key: #{pubnub.env[:subscribe_key]}"
  
  # Optional: Check for version compatibility
  # This is just an example - adjust version requirements as needed
  version_parts = Pubnub::VERSION.split('.')
  major_version = version_parts[0].to_i
  minor_version = version_parts[1].to_i
  
  if major_version >= 5 && minor_version >= 0
    puts "\nYou are using a compatible SDK version."
  else
    puts "\nWARNING: This code example may require PubNub SDK version 5.0.0 or newer."
    puts "Please consider upgrading your PubNub Ruby SDK."
  end
  
  # Clean up
  pubnub.shutdown if pubnub
end

if __FILE__ == $0
  main
end
```