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.
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
# 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.
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
$ 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
~/.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
To recap, through steps #1 and #2 we've downloaded rbenv, and then
~/.bashrc to add the following two lines
at the very bottom of the file:
export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init - bash)"
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
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
First check the version of Ruby that Dradis is currently pinned to in .ruby-version. let's say it's:
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! 🙌🔥