voormedia/rails-erd · error
The ruby-graphviz gem is required for Graphviz output. Add `
Error message
The ruby-graphviz gem is required for Graphviz output. Add `gem 'ruby-graphviz'` to your Gemfile, or use `generator=mermaid` instead.
What it means
Error "The ruby-graphviz gem is required for Graphviz output. Add `gem 'ruby-graphviz'` to your Gemfile, or use `generator=mermaid` instead." thrown in voormedia/rails-erd.
Source
Thrown at lib/rails_erd/tasks.rake:18
module ErdRakeHelper
def say(message)
puts message unless Rake.application.options.silent
end
end
namespace :erd do
task :check_dependencies do
if RailsERD.options.generator == :graphviz
begin
require 'graphviz/utils'
include GraphViz::Utils
unless find_executable("dot", nil)
raise "Unable to find GraphViz's \"dot\" executable. Please " \
"visit https://voormedia.github.io/rails-erd/install.html for installation instructions."
end
rescue LoadError
raise "The ruby-graphviz gem is required for Graphviz output. " \
"Add `gem 'ruby-graphviz'` to your Gemfile, or use `generator=mermaid` instead."
end
end
end
task :options do
(RailsERD.options.keys.map(&:to_s) & ENV.keys).each do |option|
RailsERD.options[option.to_sym] = case ENV[option]
when "true", "yes" then true
when "false", "no" then false
when /,/ then ENV[option].split(/\s*,\s*/)
when /^\d+$/ then ENV[option].to_i
else
if option == 'only'
[ENV[option]]
else
ENV[option].to_sym
endView on GitHub (pinned to dae6e52018)
Solutions
- Add `gem 'ruby-graphviz'` to your Gemfile and run `bundle install`, then re-run `bundle exec rake erd`.
- Use the mermaid generator instead, which does not need ruby-graphviz: `bundle exec rake erd generator=mermaid`.
Example fix
echo "gem 'ruby-graphviz'" >> Gemfile && bundle install
When it happens
Trigger: Raised in erd:check_dependencies when generator=graphviz but requiring 'graphviz/utils' fails with LoadError because the ruby-graphviz gem is not installed or not in the bundle.
Common situations: See trigger scenarios.
AI-assisted analysis of voormedia/rails-erd@dae6e52018 (2026-08-23).
Data as JSON: /api/errors/9710ea72605e47d0.
Report an issue: GitHub.