rdkafka 0.21.1.alpha2

Ruby gem: rdkafka

Install This Version

Using gem command

gem install rdkafka -v 0.21.1.alpha2

In your Gemfile

gem 'rdkafka', '~> 0.21.1.alpha2'

Gemspec

Gem::Specification.new do |spec|
  spec.name    = "rdkafka"
  spec.version = "0.21.1.alpha2"
  spec.authors = ["Thijs Cadier","Maciej Mensfeld"]
  spec.license = "MIT"
  spec.summary = "The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka. It wraps the production-ready C client using the ffi gem and targets Kafka 1.0+ and Ruby 2.7+."
  spec.description = "Modern Kafka client library for Ruby based on librdkafka"
  spec.homepage = "https://karafka.io"
  spec.required_ruby_version = ">= 3.1"
  spec.metadata = {
    "funding_uri" => "https://karafka.io/#become-pro",
    "homepage_uri" => "https://karafka.io",
    "changelog_uri" => "https://karafka.io/docs/Changelog-Rdkafka",
    "bug_tracker_uri" => "https://github.com/karafka/rdkafka-ruby/issues",
    "source_code_uri" => "https://github.com/karafka/rdkafka-ruby",
    "documentation_uri" => "https://karafka.io/docs",
    "rubygems_mfa_required" => "true",
  }

  spec.add_dependency "ffi", "~> 1.15"
  spec.add_dependency "mini_portile2", "~> 2.6"
  spec.add_dependency "rake", "> 12"
  spec.add_development_dependency "guard", ">= 0"
  spec.add_development_dependency "guard-rspec", ">= 0"
  spec.add_development_dependency "pry", ">= 0"
  spec.add_development_dependency "rake", ">= 0"
  spec.add_development_dependency "rspec", "~> 3.5"
  spec.add_development_dependency "simplecov", ">= 0"
end

Frequently Asked Questions

How do I lock the rdkafka gem at version 0.21.1.alpha2?

To lock this gem at this specific version, update your Gemfile:

gem 'rdkafka', '0.21.1.alpha2'

Then run:

bundle install

Note: This is an older version. Consider upgrading to the latest version (0.24.2) for the newest features and security fixes.

How do I check if rdkafka version 0.21.1.alpha2 is installed?

Run this to see all installed versions of rdkafka:

gem list rdkafka --exact

To check for this exact version and get a true/false exit code (useful in scripts):

gem list rdkafka -i -v 0.21.1.alpha2

Exits 0 if installed, 1 if not.

How do I uninstall rdkafka version 0.21.1.alpha2?

To remove this specific version:

gem uninstall rdkafka -v 0.21.1.alpha2

To remove all installed versions at once:

gem uninstall rdkafka --all

If another gem depends on this version, RubyGems will warn you. Add --force to bypass the warning, but check nothing still needs it first.

How do I unpack rdkafka version 0.21.1.alpha2?

If the gem is already installed, unpack its source into the current directory:

gem unpack rdkafka -v 0.21.1.alpha2

If it is not installed, fetch it first and then unpack the file:

gem fetch rdkafka -v 0.21.1.alpha2 gem unpack rdkafka-0.21.1.alpha2.gem

This creates a rdkafka-0.21.1.alpha2/ directory with the full source tree.

How do I download rdkafka version 0.21.1.alpha2 without installing it?

Use gem fetch to download the .gem file to the current directory:

gem fetch rdkafka -v 0.21.1.alpha2

Useful for auditing, offline installs, or mirroring to a private gem server.

How do I inspect the gemspec for rdkafka version 0.21.1.alpha2?

If the gem is installed:

gem specification rdkafka -v 0.21.1.alpha2

From a downloaded .gem file:

gem fetch rdkafka -v 0.21.1.alpha2 gem specification rdkafka-0.21.1.alpha2.gem
What Ruby version does rdkafka version 0.21.1.alpha2 require?

Version 0.21.1.alpha2 requires Ruby >= 3.1.

Check your Ruby version with ruby -v.

What dependencies does rdkafka version 0.21.1.alpha2 have?

Runtime dependencies — installed automatically with the gem:

  • ffi ~> 1.15
  • mini_portile2 ~> 2.6
  • rake > 12

Development dependencies — only needed when working on the gem itself:

  • guard >= 0
  • guard-rspec >= 0
  • pry >= 0
  • rake >= 0
  • rspec ~> 3.5
  • simplecov >= 0

To see the full resolved dependency tree after installation: gem dependency rdkafka -v 0.21.1.alpha2

How do I use rdkafka version 0.21.1.alpha2 when multiple versions are installed?

If the gem provides an executable, use the _version_ wrapper syntax:

rdkafka _0.21.1.alpha2_ [args]

In a Bundler project, pin the version in your Gemfile and run via bundle exec:

# Gemfile gem 'rdkafka', '0.21.1.alpha2'
bundle exec ruby your_script.rb

Docker Installation

Alpine Linux

FROM alpine:latest

# Install Ruby and build tools
RUN apk add --no-cache ruby ruby-dev build-base

# Note: The following dependencies do not have package lists for alpine:
# - librdkafka (canonical: librdkafka)

# Install the gem
RUN gem install rdkafka -v 0.21.1.alpha2

# Verify installation
RUN ruby -e "require 'rdkafka'; puts 'Successfully loaded rdkafka'"

Arch Linux

FROM archlinux:latest

# Install Ruby and build tools
RUN pacman -Sy --noconfirm ruby base-devel

# Note: The following dependencies do not have package lists for arch:
# - librdkafka (canonical: librdkafka)

# Install the gem
RUN gem install rdkafka -v 0.21.1.alpha2

# Verify installation
RUN ruby -e "require 'rdkafka'; puts 'Successfully loaded rdkafka'"

Debian

FROM debian:bookworm-slim

# Install Ruby and build tools
RUN apt-get update -qq && apt-get install -y --no-install-recommends ruby ruby-dev build-essential

# Note: The following dependencies do not have package lists for debian:
# - librdkafka (canonical: librdkafka)

# Install the gem
RUN gem install rdkafka -v 0.21.1.alpha2

# Verify installation
RUN ruby -e "require 'rdkafka'; puts 'Successfully loaded rdkafka'"

Fedora

FROM fedora:latest

# Install Ruby and build tools
RUN dnf install -y ruby ruby-devel gcc gcc-c++ make

# Note: The following dependencies do not have package lists for fedora:
# - librdkafka (canonical: librdkafka)

# Install the gem
RUN gem install rdkafka -v 0.21.1.alpha2

# Verify installation
RUN ruby -e "require 'rdkafka'; puts 'Successfully loaded rdkafka'"

Ubuntu

FROM ubuntu:24.04

# Install Ruby and build tools
RUN apt-get update -qq && apt-get install -y --no-install-recommends ruby ruby-dev build-essential

# Note: The following dependencies do not have package lists for ubuntu:
# - librdkafka (canonical: librdkafka)

# Install the gem
RUN gem install rdkafka -v 0.21.1.alpha2

# Verify installation
RUN ruby -e "require 'rdkafka'; puts 'Successfully loaded rdkafka'"

Nixpacks

Deploy with Nixpacks (Railway, Render, etc.)

# nixpacks.toml for rdkafka 0.21.1.alpha2

[phases.setup]
# Note: The following dependencies do not have package lists for debian:
# - librdkafka (canonical: librdkafka)

[phases.install]
cmds = ["gem install rdkafka -v 0.21.1.alpha2"]

[phases.build]
cmds = ["ruby -e \"require 'rdkafka'; puts 'Successfully loaded rdkafka'\""]

Save this as nixpacks.toml in your project root.

Cloud Native Buildpacks

Deploy with Cloud Native Buildpacks (Heroku, Paketo, etc.)

# package.toml for rdkafka 0.21.1.alpha2
# Cloud Native Buildpacks configuration

# Note: The following dependencies do not have package lists for debian:
# - librdkafka (canonical: librdkafka)

# Gem installation will be handled by the Ruby buildpack
# which automatically installs gems from Gemfile or bundler

Save this as package.toml in your project root.

Nix Shell

Develop with Nix using ruby-nixpkgs

# shell.nix for rdkafka 0.21.1.alpha2
# Usage: nix-shell
# Uses ruby-nixpkgs for gem management

{ pkgs ? import <nixpkgs> {} }:

let
  rubyVersion = pkgs.ruby_3_3;

  # Ruby environment with ruby-nixpkgs
  rubyEnv = pkgs.bundlerEnv {
    name = "rdkafka-0.21.1.alpha2";
    ruby = rubyVersion;
    gemdir = ./.;
  };
in

pkgs.mkShell {
  buildInputs = [
    rubyVersion
    pkgs.bundler
    pkgs.ruby-nixpkgs

    # Note: The following dependencies do not have package lists for nixpkgs:
    # - librdkafka (canonical: librdkafka)
  ];

  shellHook = ''
    echo "Ruby environment for rdkafka 0.21.1.alpha2"
    echo "Use: gem install rdkafka -v 0.21.1.alpha2"
  '';
}

Save this as shell.nix in your project root, then run nix-shell.

Devenv

Develop with Devenv for declarative development environments

# devenv.nix for rdkafka 0.21.1.alpha2
# Usage: devenv shell

{ pkgs, lib, config, ... }:

{
  languages.ruby = {
    enable = true;
    version = "3.3.0";
  };

  packages = [

    # Note: The following dependencies do not have package lists for nixpkgs:
    # - librdkafka (canonical: librdkafka)
  ];

  enterShell = ''
    echo "Development environment for rdkafka 0.21.1.alpha2"
    echo "Use: gem install rdkafka -v 0.21.1.alpha2"
  '';
}

Save this as devenv.nix in your project root, then run devenv shell.

Nix Flakes

Develop with Nix Flakes for reproducible development environments

# flake.nix for rdkafka 0.21.1.alpha2
# Usage: nix develop

{
  description = "Development environment for rdkafka 0.21.1.alpha2";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
        rubyVersion = pkgs.ruby_3_3;
      in
      {
        devShells.default = pkgs.mkShell {
          buildInputs = [
            rubyVersion
            pkgs.bundler

            # Note: The following dependencies do not have package lists for nixpkgs:
            # - librdkafka (canonical: librdkafka)
          ];

          shellHook = ''
            echo "Development environment for rdkafka 0.21.1.alpha2"
            echo "Use: gem install rdkafka -v 0.21.1.alpha2"
          '';
        };
      }
    );
}

Save this as flake.nix in your project root, then run nix develop.

Download Statistics

This version
551
All versions combined
19,502,770

Other Versions