生成rails项目的实体关系图

实体关系图 == Entity-Relationship Diagrams

插件官网

首先安装Graphviz

% brew install cairo pango graphviz    # Homebrew on Mac OS X

% sudo port install graphviz           # Macports on Mac OS X

% sudo aptitude install graphviz       # Debian and Ubuntu

然后在开发环境中使用

group :development do
  gem "rails-erd"
end

安装

% bundle install

生成PDF

% rake erd
comments powered by Disqus