github Download
Ruby installation

Installing RbThemis #

RbThemis is available on RubyGems and can be installed with the usual gem install. Additionally, Themis Core library has to be installed in your system as well.

Themis Core is available as a system package for Linux and macOS. Usually you want to install the stable package to benefit from automatic dependency management and security updates. However, you can also build and install the latest RbThemis from the source code.

Installing stable version on Linux #

The easiest way to install Themis on Linux is to use package repositories for your system. We build packages for a multitude of Linux distributions.

  1. Add Cossack Labs package repositories to your system.

  2. Install Themis Core development package.

    For Debian, Ubuntu:

    sudo apt install libthemis-dev

    For CentOS, RHEL:

    sudo yum install libthemis-devel
  3. Install RbThemis via RubyGems:

    gem install rbthemis

    You may need sudo for global installation, if you are not using virtual environments.

Once RbThemis is installed, you can try out code examples.

Installing stable version on macOS #

The easiest way to install Themis on macOS is to use Homebrew.

  1. Add Cossack Labs tap to your system:

    brew tap cossacklabs/tap
  2. Install Themis Core package:

    brew install libthemis
  3. Install RbThemis via RubyGems:

    gem install rbthemis

Once RbThemis is installed, you can try out code examples.

Building latest version from source #

If the stable package version does not suit your needs, you can manually build and install the latest version of Themis from source code.

  1. Build and install Themis Core library into your system.

  2. Install RbThemis package from the source code:

    If build fails due to some `.h` files missing, you may need to install additional development package.
    On Debian/Ubuntu it's `ruby-dev` while on Fedora it's called `ruby-devel`.
    make rbthemis_install

    The package will be installed globally into the system.

    If you wish to install RbThemis into the user folder, use GEM_INSTALL_OPTIONS:

    make rbthemis_install GEM_INSTALL_OPTIONS=--user-install
  3. Run RbThemis test suite to verify the installation:

    make prepare_tests_all test_ruby

Uninstalling #

To remove system-wide RbThemis installation, run sudo gem uninstall rbthemis. For user-specific installation, run gem uninstall rbthemis.

There is also make rbthemis_uninstall command available that does exactly the same.