Installing the Ruby environment for Dradis

If your answer is not here the Community Forums are your best bet.

If you're new to Ruby development, some of these steps are going to look like madness. We get it, and we're here for you if you need our help.

On the bright side, you will only need to go through this once.

Build environment

Throughout this guide we're going to compile the Ruby interpreter from source. To do so we're going to need install some packages as root:

# Depending on your version of Ubuntu/Debian/Mint, libgdbm6 won't be available.
# In that case, try an earlier version such as libgdbm5.
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev

These are the Ubuntu/Debian packages. For other environments, please see the Suggested Build Environment instructions.

Rbenv to manage Ruby versions

You can have multiple Ruby versions installed in a given system, for instance a system-wide version that comes with the operating system and different local version that you use to run some apps.

We're going to install the Ruby environment for your local user through rbenv. This will keep it self-contained and minimize dependency problems.

We are using the Basic GitHub Checkout instructions for an Ubuntu Desktop system in this guide. All commands can be run as a regular user (i.e. without sudo). Consult the instructions for other platforms.

1. Install

$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ cd ~/.rbenv && src/configure && make -C src && cd ..
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

2. Setup rbenv

~/.rbenv/bin/rbenv init
# Load rbenv automatically by appending
# the following to ~/.bashrc:

eval "$(rbenv init - bash)"

Follow the printed instructions to set up rbenv shell integration. In a default Ubuntu Desktop, you just need to add that line at the end of ~/.bashrc.

To recap, through steps #1 and #2 we've downloaded rbenv, and then modified our ~/.bashrc to add the following two lines at the very bottom of the file:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - bash)"

3. Reload your shell

Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.)

$ bash -l
$ rbenv -v
rbenv 1.2.0-6-g304cb7b

3. Get ruby-install

Because nothing is easy, rbenv lets you manage Ruby versions once they are installed, but doesn't let you install new versions out of the box because... ¯\_(ツ)_/¯ We'll use the ruby-build plugin for that:

$ mkdir -p "$(rbenv root)"/plugins
$ git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

The Ruby version that Dradis will use

First check the version of Ruby that Dradis is currently pinned to in .ruby-version. let's say it's:

3.1.2

Let's confirm that install option is available:

$ rbenv  install --list-all | grep 3.1.2
3.1.2

Great, so we'll go ahead with that:

$ rbenv install 3.1.2

This is going to take several minutes. But we're close now.

$ rbenv shell 3.1.2
$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

Now we're cooking! 🙌🔥

Streamline InfoSec Project Delivery

Learn practical tips to reduce the overhead that drags down security assessment delivery with this 5-day course. These proven, innovative, and straightforward techniques will optimize all areas of your next engagement including:

  • Scoping
  • Scheduling
  • Project Planning
  • Delivery
  • Intra-team Collaboration
  • Reporting and much more...

Your email is kept private. We don't do the spam thing.