LoginSignup
9
9

More than 5 years have passed since last update.

RailsのモデルをER図で出力する

Last updated at Posted at 2015-03-18

rails-erd

実行環境

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'.
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9