Installation

Add this line to your application’s Gemfile:

gem 'diagrams-rb', '~> 0.0.3'

or install:

gem install diagrams-rb

To use this DSL and render the .dot files it generates, you need to install Graphviz. Graphviz provides the CLI for converting .dot files into images.

Installing Graphviz

Linux

Most Linux distributions have Graphviz in their package manager:

# On Ubuntu or Debian-based systems
sudo apt update && sudo apt install graphviz

# On Fedora
sudo dnf install graphviz

# On Arch Linux
sudo pacman -S graphviz

macOS

If you have Homebrew installed, you can install Graphviz with:

brew install graphviz

Windows

You can download the installer from the official Graphviz website. Follow the instructions in the installer to complete the setup.

Verifying the Installation

After installation, verify by running:

dot -V

You should see version information if Graphviz is installed correctly.

For more details, see the Graphviz installation documentation.