実行環境
Enviroment | Version |
---|---|
OSX | 10.9.4 |
Rails | 4.2.0 |
rails-erdをインストールする
追記
$ vi ./Gemfile
Gemfile
group :development do
gem 'rails-erd'
end
インストール
$ bundle install
依存関係のライブラリをインストールする
$ brew install graphviz
ER図を作成し、表示する
$ bundle exec erd --open
--open
オプションで自動的にerd.pdf
を開く
出力結果
Loading application in 'phoenix'...
Generating entity-relationship diagram for 10 models...
Warning: Ignoring invalid association :resource on ActiveAdmin::Comment (polymorphic interface Resource does not exist)
Warning: Ignoring invalid association :author on ActiveAdmin::Comment (polymorphic interface Author does not exist)
Diagram saved to 'erd.pdf'.