Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find erd.pdf file #196

Closed
manish310794 opened this issue Apr 15, 2016 · 36 comments
Closed

cannot find erd.pdf file #196

manish310794 opened this issue Apr 15, 2016 · 36 comments
Labels

Comments

@manish310794
Copy link

I installed graphviz and the gem as per the instructions. I then cd into my project.
proj$ bundle exec erd

It says

diagram saved to 'erd.pdf'

But I cannot find any such file inside my project directory.

@kerrizor
Copy link
Collaborator

Hmmm... assuming it ran successfully, it should be saving the file into the same spot where you ran the erd command. Can you share the output of running the command, to be sure?

@manish310794
Copy link
Author

Here is the output of running the command

vagrant@canvasvmfrommybox:/vagrant/canvas$ bundle exec erd
Loading application in 'canvas'...
DEPRECATION WARNING: Syck is deprecated and support for serialization has been removed. ActiveRecord::Core#yaml_initialize will be removed in 4.1 which will break deserialization support with Syck. (called from require at /home/vagrant/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:77)
Generating entity-relationship diagram for 201 models...
Warning: Ignoring invalid model Tableless (table tablelesses does not exist)
Warning: Ignoring invalid model ContextModuleSubHeader (table tablelesses does not exist)
Warning: Ignoring invalid model ExternalUrl (table tablelesses does not exist)
Warning: Ignoring invalid association :sub_context on AppointmentGroupSubContext (polymorphic interface SubContext does not exist)
Warning: Ignoring invalid association :original_item on ClonedItem (polymorphic interface OriginalItem does not exist)
Warning: Ignoring invalid association :asset_context on DelayedNotification (polymorphic interface AssetContext does not exist)
Warning: Ignoring invalid association :association_object on LearningOutcomeResult (polymorphic interface AssociationObject does not exist)
Warning: Ignoring invalid association :asset_context on Message (polymorphic interface AssetContext does not exist)
Warning: Ignoring invalid association :association_object on RubricAssociation (polymorphic interface AssociationObject does not exist)
Diagram saved to 'erd.pdf'.

@kerrizor
Copy link
Collaborator

Hmmm... I don't know! Do you have graphviz installed properly? Also, try running bundle exec erd --filetype=dot and see if you can at least get an erd.dot file generated. Finally, and this may seem basic, but I've done it -- do you have write access to the directory you're working in?

Thanks for reporting this.. if we can solve this, we can add a bit more polish and "customer friendly" warnings if we detect something going wrong. ❤️

@manish310794
Copy link
Author

bundle exec erd --filetype=dot worked. It generated the erd.dot file. But I am not able to convert this file to pdf using dot -Tpdf erd.dot -o erd.pdf. It shows Segmentation fault (core dumped) message.

@phikes
Copy link

phikes commented Apr 25, 2016

The same thing is happening for me (exactly). I am using GraphViz version 2.38.0. I also get the segfault.

@kerrizor
Copy link
Collaborator

@manish310794 @phikes well dang. I'm on GraphViz 2.38.0 as well. Can either of you confirm that you're using the latest version of the gem (1.4.7)? The only other thing I can think of is that sinze you're getting a seg fault when you're invoking dot -- which is graphviz -- perhaps trying removing it and reinstalling it. Hopefully that's easy for you; I use HomeBrew for this, which makes it pretty simple.

@phikes
Copy link

phikes commented Apr 25, 2016

I am on brew as well and reinstalled already :/. I am on version 1.1.0 though. I will check with the latest version.

@phikes
Copy link

phikes commented Apr 25, 2016

I checked with version 1.4.7, no luck either :/. Let me know if I can do anything else.

@kerrizor
Copy link
Collaborator

Would any of the solutions in #160 or #12 work?

@phikes
Copy link

phikes commented Apr 28, 2016

I tried the second one and it did not work unfortunately.

@hjoseph96
Copy link

Having this problem also.

@kerrizor kerrizor added the Bug label May 15, 2016
@jteneycke
Copy link

jteneycke commented Jun 7, 2016

Running into it as well on El Capitan

$ dot -v
dot - graphviz version 2.38.0 (20140413.2041)
libdir = "/usr/local/Cellar/graphviz/2.38.0/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.6.dylib
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
    /usr/local/Cellar/graphviz/2.38.0/lib/graphviz/config6
        was successfully loaded.
    render  :  dot fig map pic pov ps quartz svg tk vml xdot
    layout  :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device  :  bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz xdot xdot1.2 xdot1.4
    loadimage   :  (lib) bmp eps gif jpe jpeg jpg pdf png ps svg

@joekrill
Copy link

I'm also seeing this problem (El Capitan here, too). I ran dot -Tpdf erd.dot -o erd.pdf -v (with the verbose flag) and got this output, in case it's helpful:

dot - graphviz version 2.38.0 (20140413.2041)
Using render: quartz:quartz
Using device: pdf:quartz:quartz
libdir = "/usr/local/Cellar/graphviz/2.38.0/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
The plugin configuration file:
    /usr/local/Cellar/graphviz/2.38.0/lib/graphviz/config6
        was successfully loaded.
    render  :  dot fig map pic pov ps quartz svg tk vml xdot
    layout  :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device  :  bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz xdot xdot1.2 xdot1.4
    loadimage   :  (lib) bmp eps gif jpe jpeg jpg pdf png ps svg
fontname: unable to resolve "Arial BoldMT"
pack info:
  mode   undefined
  size   0
  flags  0
  margin 8
pack info:
  mode   node
  size   0
  flags  0
fontname: unable to resolve "ArialMT"
fontname: unable to resolve "Arial ItalicMT"
network simplex:  61 nodes 112 edges maxiter=2147483647 balance=1
network simplex: 61 nodes 112 edges 5 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
Maxrank = 9, minrank = 0
mincross: pass 0 iter 0 trying 0 cur_cross 479 best_cross 479
mincross: pass 0 iter 1 trying 0 cur_cross 410 best_cross 410
mincross: pass 0 iter 2 trying 0 cur_cross 302 best_cross 302
mincross: pass 0 iter 3 trying 0 cur_cross 273 best_cross 273
mincross: pass 1 iter 0 trying 0 cur_cross 564 best_cross 182
mincross: pass 1 iter 1 trying 1 cur_cross 390 best_cross 182
mincross: pass 1 iter 2 trying 2 cur_cross 309 best_cross 182
mincross: pass 1 iter 3 trying 3 cur_cross 290 best_cross 182
mincross: pass 2 iter 0 trying 0 cur_cross 182 best_cross 182
mincross: pass 2 iter 1 trying 1 cur_cross 303 best_cross 182
mincross: pass 2 iter 2 trying 2 cur_cross 295 best_cross 182
mincross: pass 2 iter 3 trying 3 cur_cross 241 best_cross 182
mincross: pass 2 iter 4 trying 0 cur_cross 163 best_cross 163
mincross: pass 2 iter 5 trying 1 cur_cross 280 best_cross 163
mincross: pass 2 iter 6 trying 2 cur_cross 276 best_cross 163
mincross: pass 2 iter 7 trying 3 cur_cross 216 best_cross 163
mincross: pass 2 iter 8 trying 4 cur_cross 188 best_cross 163
mincross: pass 2 iter 9 trying 5 cur_cross 266 best_cross 163
mincross: pass 2 iter 10 trying 6 cur_cross 206 best_cross 163
mincross: pass 2 iter 11 trying 7 cur_cross 193 best_cross 163
mincross: pass 2 iter 12 trying 0 cur_cross 158 best_cross 158
mincross: pass 2 iter 13 trying 1 cur_cross 272 best_cross 158
mincross: pass 2 iter 14 trying 2 cur_cross 224 best_cross 158
mincross: pass 2 iter 15 trying 3 cur_cross 192 best_cross 158
mincross: pass 2 iter 16 trying 4 cur_cross 159 best_cross 158
mincross: pass 2 iter 17 trying 5 cur_cross 300 best_cross 158
mincross: pass 2 iter 18 trying 6 cur_cross 276 best_cross 158
mincross: pass 2 iter 19 trying 7 cur_cross 218 best_cross 158
mincross: pass 2 iter 20 trying 8 cur_cross 177 best_cross 158
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
merge2: graph True, rank 2 has only 18 < 27 nodes
merge2: graph True, rank 3 has only 35 < 46 nodes
merge2: graph True, rank 4 has only 48 < 67 nodes
merge2: graph True, rank 5 has only 34 < 40 nodes
merge2: graph True, rank 6 has only 37 < 41 nodes
merge2: graph True, rank 7 has only 22 < 26 nodes
mincross True: 158 crossings, 0.02 secs.
Segmentation fault: 11

I'm not sure this actually provides any more useful information beyond the fact that it segfaulted -- I don't really know how to interpret any of these messages. Also wanted to note that I had no problems generating diagrams with RailRoady, which also uses graphviz in a similar way.

@ajvb
Copy link

ajvb commented Aug 31, 2016

Same thing happened with me. Here is the verbose output if it is helpful:

$ dot -Tpdf erd.dot -o erd.pdf -v
dot - graphviz version 2.38.0 (20140413.2041)
Using render: quartz:quartz
Using device: pdf:quartz:quartz
libdir = "/usr/local/Cellar/graphviz/2.38.0/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
The plugin configuration file:
        /usr/local/Cellar/graphviz/2.38.0/lib/graphviz/config6
                was successfully loaded.
    render      :  dot fig map pic pov ps quartz svg tk vml xdot
    layout      :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device      :  bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz xdot xdot1.2 xdot1.4
    loadimage   :  (lib) bmp eps gif jpe jpeg jpg pdf png ps svg
fontname: unable to resolve "Arial BoldMT"
pack info:
  mode   undefined
  size   0
  flags  0
  margin 8
pack info:
  mode   node
  size   0
  flags  0
fontname: unable to resolve "ArialMT"
fontname: unable to resolve "Arial ItalicMT"
network simplex:  349 nodes 1662 edges maxiter=2147483647 balance=1
network simplex: 349 nodes 1662 edges 73 iter 0.02 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  3 nodes 2 edges maxiter=2147483647 balance=1
network simplex: 3 nodes 2 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
Maxrank = 30, minrank = 0
mincross: pass 0 iter 0 trying 0 cur_cross 218073 best_cross 218073
mincross: pass 0 iter 1 trying 0 cur_cross 198405 best_cross 198405
mincross: pass 0 iter 2 trying 0 cur_cross 183778 best_cross 183778
mincross: pass 0 iter 3 trying 0 cur_cross 160025 best_cross 160025
mincross: pass 1 iter 0 trying 0 cur_cross 275031 best_cross 160025
mincross: pass 1 iter 1 trying 1 cur_cross 190269 best_cross 160025
mincross: pass 1 iter 2 trying 2 cur_cross 171777 best_cross 160025
mincross: pass 1 iter 3 trying 3 cur_cross 172831 best_cross 160025
mincross: pass 2 iter 0 trying 0 cur_cross 160025 best_cross 160025
mincross: pass 2 iter 1 trying 1 cur_cross 181022 best_cross 160025
mincross: pass 2 iter 2 trying 2 cur_cross 172088 best_cross 160025
mincross: pass 2 iter 3 trying 0 cur_cross 158650 best_cross 158650
mincross: pass 2 iter 4 trying 1 cur_cross 160402 best_cross 158650
mincross: pass 2 iter 5 trying 2 cur_cross 192888 best_cross 158650
mincross: pass 2 iter 6 trying 3 cur_cross 176103 best_cross 158650
mincross: pass 2 iter 7 trying 4 cur_cross 173921 best_cross 158650
mincross: pass 2 iter 8 trying 5 cur_cross 169309 best_cross 158650
mincross: pass 2 iter 9 trying 6 cur_cross 186940 best_cross 158650
mincross: pass 2 iter 10 trying 7 cur_cross 171935 best_cross 158650
mincross: pass 2 iter 11 trying 8 cur_cross 159669 best_cross 158650
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
merge2: graph Procore, rank 3 has only 115 < 116 nodes
merge2: graph Procore, rank 4 has only 126 < 129 nodes
merge2: graph Procore, rank 5 has only 149 < 156 nodes
merge2: graph Procore, rank 6 has only 299 < 366 nodes
merge2: graph Procore, rank 7 has only 310 < 377 nodes
merge2: graph Procore, rank 8 has only 333 < 397 nodes
merge2: graph Procore, rank 9 has only 335 < 399 nodes
merge2: graph Procore, rank 10 has only 421 < 494 nodes
merge2: graph Procore, rank 11 has only 418 < 485 nodes
merge2: graph Procore, rank 12 has only 590 < 671 nodes
merge2: graph Procore, rank 13 has only 591 < 674 nodes
merge2: graph Procore, rank 14 has only 577 < 650 nodes
merge2: graph Procore, rank 15 has only 692 < 776 nodes
merge2: graph Procore, rank 16 has only 667 < 748 nodes
merge2: graph Procore, rank 17 has only 666 < 737 nodes
merge2: graph Procore, rank 18 has only 654 < 720 nodes
merge2: graph Procore, rank 19 has only 620 < 683 nodes
merge2: graph Procore, rank 20 has only 618 < 681 nodes
merge2: graph Procore, rank 21 has only 591 < 644 nodes
merge2: graph Procore, rank 22 has only 604 < 651 nodes
merge2: graph Procore, rank 23 has only 627 < 672 nodes
merge2: graph Procore, rank 24 has only 626 < 660 nodes
merge2: graph Procore, rank 25 has only 643 < 671 nodes
merge2: graph Procore, rank 26 has only 595 < 620 nodes
merge2: graph Procore, rank 27 has only 509 < 526 nodes
merge2: graph Procore, rank 28 has only 405 < 411 nodes
merge2: graph Procore, rank 29 has only 112 < 113 nodes
mincross Procore: 158650 crossings, 6.17 secs.
Segmentation fault: 11

@mattvanhorn
Copy link

I'm also getting this same segfault on version 1.5.0 with GraphViz 2.38.0

@mcfadden
Copy link

I'm getting this as well on 1.5.0 with GraphViz 2.38.0 I think this is due to the large number of models as it works when I limit it to just a handful of models in my app. Ex:

bundle exec rake erd only="Model1,Model2,Model3"

@kerrizor
Copy link
Collaborator

@mcfadden that's an interesting possibility, a timeout or error of some kind from the size.. out of curiosity, how many models in your app?

@mcfadden
Copy link

I'm not so sure about a Timeout, only because I get the error instantly when running dot -Tpdf erd.dot -o erd.pdf, but some other error resulting from that is quite likely.

The app I ran this against has ~125 models.

@kerrizor
Copy link
Collaborator

Hmmm yeah, its probably not size then; I've run this against apps with multiple 💯 s of models.

@adaam2
Copy link

adaam2 commented Jun 12, 2017

Is there any update on this?

@kerrizor
Copy link
Collaborator

Similar reports in #200 and #201

Are you running into this, @adaam2 ?

@adaam2
Copy link

adaam2 commented Jun 13, 2017

Got around this issue by generating the .dot file first and that seemed to remedy it

@satyagrahi
Copy link

Not getting pdf. Just installed it today so have latest versions. Can get dot file generated, but not pdf (even after creating the dot). Not able to find it anywhere on the system (looked everywhere just in case). On MacOS Sierra (10.12.5) and .rvm/gems/ruby-1.9.3-p545/gems/rails-erd-1.5.2

Converting the dot file generates a segmentation fault:

» dot -Tpdf erd.dot -o erd.pdf -v
dot - graphviz version 2.40.1 (20161225.0304)
Using render: quartz:quartz
Using device: pdf:quartz:quartz
libdir = "/usr/local/Cellar/graphviz/2.40.1/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
The plugin configuration file:
	/usr/local/Cellar/graphviz/2.40.1/lib/graphviz/config6
		was successfully loaded.
    render	:  dot dot_json fig gd json json0 map mp pic pov ps quartz svg tk vml vrml xdot xdot_json
    layout	:  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout	:  textlayout
    device	:  bmp canon cgimage cmap cmapx cmapx_np dot dot_json eps exr fig gd gd2 gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg json json0 mp pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz vrml wbmp xdot xdot1.2 xdot1.4 xdot_json
    loadimage	:  (lib) bmp eps gd gd2 gif jpe jpeg jpg pdf png ps svg xbm
fontname: unable to resolve "Arial BoldMT"
pack info:
  mode   undefined
  size   0
  flags  0
  margin 8
pack info:
  mode   node
  size   0
  flags  0
fontname: unable to resolve "ArialMT"
fontname: unable to resolve "Arial ItalicMT"
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  73 nodes 123 edges maxiter=2147483647 balance=1
network simplex: 73 nodes 123 edges 5 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  5 nodes 4 edges maxiter=2147483647 balance=1
network simplex: 5 nodes 4 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
Maxrank = 9, minrank = 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 710 best_cross 710
mincross: pass 0 iter 1 trying 0 cur_cross 584 best_cross 584
mincross: pass 0 iter 2 trying 0 cur_cross 379 best_cross 379
mincross: pass 0 iter 3 trying 0 cur_cross 219 best_cross 219
mincross: pass 1 iter 0 trying 0 cur_cross 707 best_cross 180
mincross: pass 1 iter 1 trying 1 cur_cross 399 best_cross 180
mincross: pass 1 iter 2 trying 2 cur_cross 311 best_cross 180
mincross: pass 1 iter 3 trying 3 cur_cross 202 best_cross 180
mincross: pass 2 iter 0 trying 0 cur_cross 180 best_cross 180
mincross: pass 2 iter 1 trying 1 cur_cross 422 best_cross 180
mincross: pass 2 iter 2 trying 2 cur_cross 481 best_cross 180
mincross: pass 2 iter 3 trying 3 cur_cross 354 best_cross 180
mincross: pass 2 iter 4 trying 4 cur_cross 347 best_cross 180
mincross: pass 2 iter 5 trying 5 cur_cross 411 best_cross 180
mincross: pass 2 iter 6 trying 6 cur_cross 325 best_cross 180
mincross: pass 2 iter 7 trying 7 cur_cross 214 best_cross 180
mincross: pass 2 iter 8 trying 8 cur_cross 227 best_cross 180
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
merge2: graph Code, rank 1 has only 13 < 14 nodes
merge2: graph Code, rank 2 has only 12 < 13 nodes
merge2: graph Code, rank 3 has only 15 < 18 nodes
merge2: graph Code, rank 4 has only 42 < 47 nodes
merge2: graph Code, rank 5 has only 52 < 60 nodes
merge2: graph Code, rank 6 has only 37 < 39 nodes
merge2: graph Code, rank 7 has only 30 < 31 nodes
merge2: graph Code, rank 8 has only 11 < 12 nodes
mincross Code: 180 crossings, 0.02 secs.
[1]    5456 segmentation fault  dot -Tpdf erd.dot -o erd.pdf -v

@kerrizor
Copy link
Collaborator

Oh. Derp. Do you have "Arial BoldMT" installed? We might not be handling a fallback case correctly here..

@satyagrahi
Copy link

I have "Arial Rounded MT Bold" installed. Can't find "Arial BoldMT" on the web.

@andrewpatterson3001
Copy link

I am also unable to generate a PDF from the dot and I do not have Arial BoldMT installed.

@mjparrott
Copy link

Also having this issue where there is no erd.pdf in sight. Tried installing Arial BoldMT from a couple sources but still didn't work.

@brianbolnick
Copy link

Having the same problem here, lots of models in my case too. Would love an update to this!

@kerrizor
Copy link
Collaborator

kerrizor commented Oct 6, 2017

I think the missing font is a red herring; something about our dot output is triggering a segfault.

Anyone able to share a DOT that is causing this?

@eronisko
Copy link

Hi, sharing my DOT file.
https://drive.google.com/open?id=1rymB5dBTYJqMk5RLZf8UQQpqVAi9i-Oa

Note that it's made out of 150 models. Here's the code: slovensko-digital/harvester.ecosystem#23

@pedros007
Copy link

pedros007 commented Dec 5, 2017

I had the same problems reported above: bundle exec erd would print diagram saved to 'erd.pdf', but no such file was created to disk. I found a fix that works for me:

  1. Run bundle exec erd --filetype=dot
  2. Edit erd.dot and delete the line concentrate = "true";
  3. Run dot -v -Tpdf erd.dot -o erd.pdf
  4. Profit!

If I didn't comment out concentrate = "true";, GraphViz would Segmentation fault: 11 on both Debian with GraphViz installed via apt and Mac OSX with GraphViz installed via brew.

Alternatively, I can generate erd.pdf if I create config/initializers/erd.rb with the patch recommended here from #70 :

require 'rails_erd/domain/relationship'

module RailsERD
  class Domain
    class Relationship
      class << self
        private

        def association_identity(association)
          Set[association_owner(association), association_target(association)]
        end
      end
    end
  end
end

Version info:

$ dot -V
dot - graphviz version 2.38.0 (20140413.2041)
$ erd --version
RailsERD 1.5.2

@mustela
Copy link

mustela commented Jan 4, 2018

Having the same problem here, Ive tried all the different approaches mentioned here, but with same results.

@mustela
Copy link

mustela commented Jan 4, 2018

Actually this erd --inheritance --direct --attributes=foreign_keys,content is working...

@rlugge
Copy link

rlugge commented Apr 26, 2018

I'm getting the same error. I can generate the dotfile, but if I try to generate a PDF it just silently fails, telling me the PDF was generated.

erd --inheritance --direct --attributes=foreign_keys,content works.

Also, if I run rails c and then:

(ActiveRecord::Base.connection.tables - %w[schema_migrations]).each do |table|
  table.classify.constantize rescue nil
end

RailsERD::Diagram::Graphviz.create

That also works

@Cardds
Copy link

Cardds commented Jul 3, 2018

@kerrizor

Had same issue. Verified that bundle exec erd --filetype=dot produced the dot file output correctly, which led to a seg fault when parsing with the dot command (no matter the type of output). Found that neato would produce output with the same dot file. Upon further investigation, found that the dot file provided had duplicated edges, likeso:

  m_Address -> m_Company [arrowhead = "normal", arrowtail = "none", weight = "5"];
  m_Address -> m_Company [arrowhead = "normal", arrowtail = "none", weight = "5"];

Modifying the dot file to remove the duplicate edges allowed the dot command to run successfully and produce the output.

@kerrizor
Copy link
Collaborator

It appears that Graphviz segfaults when trying to draw multiple edges between the same 2 nodes. #70

Should be fixed in #296 and in the v.1.6.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests