Installing ERD on macOS for Rails Development

Recently, I helped a client migrate their legacy desktop application to a web based app.

One of the tools I used was ERD. Here is a sample of the ERD view of an unfinished Rails app I am working on:

I also tested this on my Discourse dev setup (macOS), and it was buggy, but I did manage to get some results (needs work for sure).

This was fairly easy to setup on macOS:

Install GraphViz

$ brew install graphviz

Add these Ruby Gems to your Gemfile

gem 'erd'
gem 'ruby-graphviz'

Install

$ bundle install

(... or whatever you use to get your Gems working).

ERD is not "perfect" and seems to work best on smaller projects; but I don't have enough experience with it yet to say for sure.

There is both an erd and a rails-erd gem. I tried both today, but was able to get the erd Gem below up and running faster. Later I will try rails-erd for fun.

Reference:

See also:

https://rubygems.org/gems/erd

1 Like