Installing Ronin on macOS

Copy/Paste Instructions

brew install gcc make ruby
brew pin ruby
echo 'PATH="$(brew --prefix ruby)/bin:$PATH"' >> ~/.zshrc
echo 'PATH="$(gem env gemdir)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
brew install readline sqlite
sudo gem install ronin

Detailed Breakdown

Build Dependencies

First we will need to install gcc and make. These are required to install gems which contain C extensions (aka C bindings) to other C libraries, such as the sqlite3 gem which compiles against libsqlite3.

brew install gcc make

Ruby

Next, we will need to install Ruby >= 3.0.0, which should already be available in your system’s package manager.

brew install ruby

Next we will need to “pin” the Homebrew’s version of Ruby.

brew pin ruby

Then we will need to make Homebrew’s version of Ruby the default Ruby by adding it to the PATH environment variable in ~/.zshrc and reloading the shell’s configuration.

echo 'PATH="$(brew --prefix ruby)/bin:$PATH"' >> ~/.zshrc
echo 'PATH="$(gem env gemdir)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

C libraries

Then, we will need to install various C libraries which are used by some of the Ruby gems, such as libsqlite3 which is required by the sqlite3 gem.

brew install readline sqlite

Ronin

Now that everything else is installed, it is time to install Ronin!

sudo gem install ronin

Postinstall

Assuming no errors occur, you should now be able to run ronin:

ronin help

Troubleshooting

Ruby and many ruby gems will not work if the LANG environment variable is not set or set to C. Make sure that LANG is set to a UTF8 language, such as en_US.UTF-8.