Skip to content

Installing libsodium

Matthew Carey edited this page Dec 6, 2020 · 2 revisions

discordrb uses RbNaCl to encrypt voice communication, which uses libsodium internally. RbNaCl is automatically installed together with discordrb, but libsodium will have to be installed separately. If you're not interested in voice support, it's two lines of output you can ignore, don't worry about it!

Alternatively, you can create a DISCORDRB_NONACL environment variable with any value to suppress the message.

libsodium is covered by an ISC license, available here.

Linux

If you're on Linux, just install libsodium from your favourite package manager and it should work by itself. Note that, depending on your distribution, you may also need to install development headers.

Windows

On Windows, follow these steps:

  1. Download the latest libsodium-X.Y.Z-msvc.zip from here.
  2. From the downloaded zip file, extract the x64/Release/v120/dynamic/libsodium.dll file to somewhere.
  3. Copy that to any folder within the Ruby $LOAD_PATH or C:\Windows\System32 and rename it to sodium.dll.

You can add a folder to your $LOAD_PATH either at runtime or via the -I command line flag (ruby -I ./my_dlls bot.rb).

You can also read about process of installation here.

Mac

Install Homebrew (if you don't already have it)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Libsodium

brew install libsodium