ERD diagrams in Ruby on Rails

Problem

You would like to have an ERD diagram of your database in your Ruby on Rails project.

Solution

You can install the Rails ERD from here, and install it by following the instructions.
For Ubuntu/debian systems should be:

sudo apt-get install graphviz

and then adding the gem to your Gemfile in the development section as:

group :development do
  gem "rails-erd", "~> 0.4.5"
end

You can then run bundle install to install the gem and rake erb to create the diagram pdf.