Prerequisites
Before installing the SDK, ensure you have:- Ruby 3.0 or higher installed on your system
- Bundler for dependency management (recommended)
- A Zitadel account with API credentials
Check Your Ruby Version
Verify your Ruby version meets the minimum requirement:ruby 3.0.0 or higher. If you need to upgrade Ruby, visit ruby-lang.org.
Installation Methods
You can install the SDK using either RubyGems directly or Bundler (recommended).Option 1: Using Bundler (Recommended)
Add the gem to yourGemfile:
Gemfile
Option 2: Using RubyGems
Install the gem directly:Option 3: Quick Add with Bundler CLI
Add the gem and install in one command:Dependencies
The SDK automatically installs the following dependencies:Core Dependencies
Core Dependencies
- oauth2 (~> 2.0) - OAuth2 client library for token management
- typhoeus (~> 1.0) - Fast HTTP client built on libcurl
- zeitwerk (~> 2.5) - Efficient code loading
Standard Library Dependencies
Standard Library Dependencies
- cgi (>= 0.1) - CGI support
- date (>= 3.0) - Date and time handling
- logger (>= 1.4) - Logging functionality
- net-http (>= 0.1) - HTTP client
- tempfile (>= 0.1) - Temporary file management
- time (>= 0.1) - Time utilities
- uri (>= 0.10) - URI parsing
- warning (~> 1.5.0) - Warning management
Verify Installation
After installation, verify the SDK is available:Project Setup
Once installed, require the SDK in your Ruby files:Gemfile.
In a Ruby Script
script.rb
In a Rails Application
Create an initializer:config/initializers/zitadel.rb
Troubleshooting
Common Installation Issues
Ruby Version Too Old
Ruby Version Too Old
Missing libcurl (typhoeus dependency)
Missing libcurl (typhoeus dependency)
Error: Then retry the installation:
Failed to build gem native extension for typhoeusSolution: Install libcurl development headers:Permission Denied
Permission Denied
Error:
You don't have write permissionsSolution: Either use Bundler (recommended) or install with sudo:Network/Proxy Issues
Network/Proxy Issues
Error:
Connection timeout or Unable to download dataSolution: Configure gem sources and proxy settings:Conflicting Dependencies
Conflicting Dependencies
Error:
Bundler could not find compatible versionsSolution: Update your bundle or try:Verify Network Connectivity
Test that you can reach Zitadel’s API:example.zitadel.cloud with your actual Zitadel instance URL.
Enable Debug Logging
If you encounter issues, enable debug mode to see detailed HTTP logs:Configuration Options
The SDK supports various configuration options:Next Steps
Now that the SDK is installed, you’re ready to authenticate and make your first API call:Quickstart Guide
Learn how to authenticate and create your first user in minutes