Installing Graphviz El Capitan: Unable to find GraphViz's "dot" executable.

I was trying to install rails-erd: Rails ERD generates diagrams using Graphviz, a visualization library. Continue to read how to install Graphviz and Rails ERD, so you can start creating model diagrams.

I used to have installed graphviz with brew, but I recommend for this one use MacPorts instead I followed this and worked well.

MacPorts pkg installer for your version of osx:

Go to the terminal:
sudo port -v selfupdate

Install graphviz via MacPorts. in terminal:
sudo port install graphviz-gui

installed gui application can be found here: /Application/Macports/Graphviz.app

Now you can run:

$ rake erd

Update Feb 2 2018:

$ erd
Loading application in 'demo'...  
WARN: Unresolved specs during Gem::Specification.reset:  
      json (>= 1.7.7, ~> 1.7)
      minitest (~> 5.1)
WARN: Clearing out unresolved specs.  
Please report a bug if this causes problems.  
Generating entity-relationship diagram for 14 models...  
Failed: RuntimeError: Saving diagram failed!  
Verify that Graphviz is installed and in your path, or use filetype=dot.  
$ brew doctor
Warning: You have unlinked kegs in your Cellar  
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on  
those kegs to fail to run properly once built. Run `brew link` on these:  
  graphviz
$ brew link graphviz
Linking /usr/local/Cellar/graphviz/2.40.1...  
Error: Could not symlink lib/graphviz/config6  
Target /usr/local/lib/graphviz/config6  
already exists. You may want to remove it:  
  rm '/usr/local/lib/graphviz/config6'

To force the link and overwrite all conflicting files:  
  brew link --overwrite graphviz

To list all files that would be deleted:  
  brew link --overwrite --dry-run graphviz

Use:

$ sudo chown -R $(whoami) /usr/local/lib/graphviz
$ brew link graphviz
Linking /usr/local/Cellar/graphviz/2.40.1...  
Error: Could not symlink lib/graphviz/libgvplugin_core.6.dylib  
Target /usr/local/lib/graphviz/libgvplugin_core.6.dylib  
already exists. You may want to remove it:  
  rm '/usr/local/lib/graphviz/libgvplugin_core.6.dylib'

To force the link and overwrite all conflicting files:  
  brew link --overwrite graphviz

To list all files that would be deleted:  
  brew link --overwrite --dry-run graphviz

Overwrite:

$  brew link --overwrite graphviz
Linking /usr/local/Cellar/graphviz/2.40.1... 215 symlinks created  
$ erd
Loading application in 'demo'...  
WARN: Unresolved specs during Gem::Specification.reset:  
      json (>= 1.7.7, ~> 1.7)
      minitest (~> 5.1)
WARN: Clearing out unresolved specs.  
Please report a bug if this causes problems.  
Generating entity-relationship diagram for 14 models...  
Diagram saved to 'erd.pdf'.  

Diagram saved to 'erd.pdf'. 🍻

And your issue will be solved, that's all folks!

Victor Velazquez

Coder, Musician, Startups, Passionate Dancer & Life Lover. Software Engineer at MagmaLabs, Co-founder of Web Dev Talks, Co-founder of Voltaire, Co-founder of Paqkit, Ex-co-founder of Zaznova.

Subscribe to The zazvick's blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!