Please see the main PostHog docs.
Specifically, the Ruby integration details.
Important
Use a single client instance (singleton) — Create the PostHog client once and reuse it throughout your application. Multiple client instances with the same API key can cause dropped events and inconsistent behavior. The SDK will log a warning if it detects multiple instances. For Rails apps, use PostHog.init in an initializer (see posthog-rails).
Important
Supports Ruby 3.2 and above
We will lag behind but generally not support versions which are end-of-life as listed here https://www.ruby-lang.org/en/downloads/branches/
All 2.x versions of the PostHog Ruby library are compatible with Ruby 2.0 and above if you need Ruby 2.0 support.
Using Rails? Check out posthog-rails for automatic exception tracking, ActiveJob instrumentation, and Rails-specific features.
See CONTRIBUTING.md for local setup, example, and test instructions.
For release instructions, see RELEASING.md.