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

Error: in routesplines, cannot find NORMAL edge #70

Closed
apfritts opened this issue Mar 21, 2014 · 23 comments · Fixed by #190
Closed

Error: in routesplines, cannot find NORMAL edge #70

apfritts opened this issue Mar 21, 2014 · 23 comments · Fixed by #190
Labels
Milestone

Comments

@apfritts
Copy link

Howdy!

I'm trying to generate a graph in Rails 4. I can generate erd.dot, but I cannot generate a PDF. This is the output I get from rake erd

Loading application environment...
Loading code in search of Active Record models...
Generating Entity-Relationship Diagram for 24 models...
Warning: Ignoring invalid association :resource on Role (polymorphic interface Resource does not exist)
Warning: Ignoring invalid association :service on InvoiceItem (polymorphic interface Service does not exist)
rake aborted!
Saving diagram failed!
Graphviz produced errors. Verify it has support for filetype=pdf, or use filetype=dot.
Original error: Error: in routesplines, cannot find NORMAL edge
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/diagram/graphviz.rb:195:in `rescue in block in <class:Graphviz>'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/diagram/graphviz.rb:190:in `block in <class:Graphviz>'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:142:in `instance_eval'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:142:in `save'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:120:in `create'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:74:in `create'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/gems/rails-erd-1.1.0/lib/rails_erd/tasks.rake:41:in `block (2 levels) in <top (required)>'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/bin/ruby_executable_hooks:15:in `eval'
/Users/apfritts/.rvm/gems/ruby-2.0.0-p353@registrar/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => erd => erd:generate
(See full trace by running task with --trace)

The CoreText performance warning is repeated many times, but I'm not concerned about it (or maybe I should be?).

This is what I get when I run it verbosely dot -Tpdf -oERD.pdf -v erd.dot:

dot - graphviz version 2.36.0 (20140111.2315)
Using render: quartz:quartz
Using device: pdf:quartz:quartz
libdir = "/usr/local/Cellar/graphviz/2.36.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.36.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

[ LOTS OF PERFORMANCE WARNINGS ]

network simplex:  1 nodes 0 edges maxiter=2147483647 balance=1
network simplex: 1 nodes 0 edges 0 iter 0.00 sec
network simplex:  16 nodes 24 edges maxiter=2147483647 balance=1
network simplex: 16 nodes 24 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 = 4, minrank = 0
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross: pass 0 iter 0 trying 0 cur_cross 7 best_cross 7
mincross: pass 0 iter 1 trying 1 cur_cross 9 best_cross 7
mincross: pass 0 iter 2 trying 0 cur_cross 4 best_cross 4
mincross: pass 0 iter 3 trying 0 cur_cross 3 best_cross 3
mincross: pass 1 iter 0 trying 0 cur_cross 6 best_cross 3
mincross: pass 1 iter 1 trying 1 cur_cross 8 best_cross 3
mincross: pass 1 iter 2 trying 2 cur_cross 11 best_cross 3
mincross: pass 1 iter 3 trying 3 cur_cross 8 best_cross 3
mincross: pass 2 iter 0 trying 0 cur_cross 3 best_cross 3
mincross: pass 2 iter 1 trying 1 cur_cross 6 best_cross 3
mincross: pass 2 iter 2 trying 2 cur_cross 3 best_cross 3
mincross: pass 2 iter 3 trying 3 cur_cross 3 best_cross 3
mincross: pass 2 iter 4 trying 4 cur_cross 3 best_cross 3
mincross: pass 2 iter 5 trying 5 cur_cross 10 best_cross 3
mincross: pass 2 iter 6 trying 6 cur_cross 4 best_cross 3
mincross: pass 2 iter 7 trying 7 cur_cross 4 best_cross 3
mincross: pass 2 iter 8 trying 8 cur_cross 3 best_cross 3
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 BaseApp, rank 1 has only 3 < 11 nodes
merge2: graph BaseApp, rank 2 has only 10 < 14 nodes
mincross BaseApp: 3 crossings, 0.00 secs.
network simplex:  64 nodes 93 edges maxiter=2147483647 balance=2
network simplex: 64 nodes 93 edges 11 iter 0.00 sec
Error: in routesplines, cannot find NORMAL edge
Segmentation fault: 11

Any help is appreciated!

@thoughtpunch
Copy link

+1 👍

@codez
Copy link

codez commented Sep 1, 2014

same here

@bf4
Copy link
Collaborator

bf4 commented Sep 1, 2014

Fixes appreciated

@wtca
Copy link

wtca commented Sep 5, 2014

This would be great to figure out. No solution seems to help. I've tried reinstalling graphviz --with-pangocairo, reinstalling everything but nothing helps.

@codez
Copy link

codez commented Nov 19, 2014

I had a look at the generated DOT. My graphviz version (2.36.0 (20140111.2315)) seg faults when there are multiple edges (=associations) between the same two nodes (=models). This may occur for example when a model tracks the modifying user with creator, updater and deleter associations.

Because rails-erd does not include any labels on the edges, I did not see the point in having multiple edges and removed them with the following patch:

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

This made the seg faults disappear, diagrams are generated fine again.

@kerrizor kerrizor added the Bug label Dec 14, 2014
@RushOnline
Copy link

@codez please help: what file path of you patch must be to make things right? Where to place your patch?

@codez
Copy link

codez commented Dec 15, 2014

I usually put patches into config/initializers

@RushOnline
Copy link

@codez thank you! I'm always forget this is rails...

@KelseyDH
Copy link

Thanks @codez ! Your initializer patch, along with recent changes to this gem and graphviz have finally allowed me to get this gem into a state that works again. Much appreciation to @kerrizor for reviving this gem too!

@kerrizor
Copy link
Collaborator

@KelseyDH Thanks! Could I trouble you to try the new 1.3 version of rails-erd and update this thread on whether or not its still an issue?

@KelseyDH
Copy link

@kerrizor, For rails-erd 2.3.0, with the exception of bundle exec rake erd filetype=dot, all of the rails-erd commands fail without the @codez initializer patch. With the @codez patch rails-erd 2.3.0 works.

I'll note I had some problems today with graphviz, which led me to uninstalling and reinstalling graphviz with brew, so that I am now on graphviz-2.38.0.yosemite:

When I run the rails-erd I get the following as the starting output (with the association problems possibly due to problems with the app), which I'll post so that my output is more helpful:

** Invoke erd (first_time)
** Invoke erd:generate (first_time)
** Invoke erd:options (first_time)
** Execute erd:options
  erd:options -->   0.000000   0.000000   0.000000 (  0.000068)
** Invoke erd:load_models (first_time)
** Execute erd:load_models
Loading application environment......** Invoke environment (first_time)
** Execute environment
Connecting to database specified by database.yml
  environment -->   0.630000   0.070000   0.700000 (  0.710463)
Loading code in search of Active Record models......  erd:load_models -->   1.920000   0.130000   2.050000 (  2.064571)
** Execute erd:generate
Generating Entity-Relationship Diagram for 64 models......Warning: Ignoring invalid model MailToPatient (table mail_to_patients does not exist)
Warning: Ignoring invalid model SpecializationOwner (table specialization_owners does not exist)
Warning: Ignoring invalid association :favoritable on Favorite (polymorphic interface Favoritable does not exist)
Warning: Ignoring invalid association :sc_items on Specialization (Could not find the association :sc_items_specializations in model Specialization)

And then for various commands I get the following....

With @codez patch, rails-erd (1.3.0) works:

Works(?): bundle exec rake erd filetype=dot
Works: bundle exec rake erd filetype=pdf
Works: bundle exec rake erd, with this output when running --trace:

Done! Saved diagram to erd.pdf....  erd:generate -->   0.460000   0.020000   0.610000 (  0.600189)
** Execute erd
  erd -->   0.000000   0.000000   0.000000 (  0.000074)

without @codez patch, rails-erd (1.3.0) fails:

Works(?) bundle exec rake erd filetype=dot
Fails: bundle exec rake erd filetype=pdf
Fails: bundle exec rake erd ~> with this end output when running —trace:

rake aborted!
Saving diagram failed!
Graphviz produced errors. Verify it has support for filetype=pdf, or use filetype=dot.
Original error: Error: in routesplines, cannot find NORMAL edge
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/diagram/graphviz.rb:202:in `rescue in block in <class:Graphviz>'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/diagram/graphviz.rb:197:in `block in <class:Graphviz>'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:142:in `instance_eval'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:142:in `save'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:120:in `create'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:74:in `create'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rails-erd-1.3.0/lib/rails_erd/tasks.rake:41:in `block (2 levels) in <top (required)>'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-benchmark-1.0.0/lib/rake/benchmark.rb:8:in `block in execute_with_benchmark'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-benchmark-1.0.0/lib/rake/benchmark.rb:7:in `execute_with_benchmark'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:201:in `block in invoke_prerequisites'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:199:in `each'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_prerequisites'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:178:in `block in invoke_with_call_chain'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
$PATH/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
$PATH/.rbenv/versions/2.0.0-p481/bin/rake:23:in `load'
$PATH/.rbenv/versions/2.0.0-p481/bin/rake:23:in `<main>’

@n8gard
Copy link

n8gard commented Mar 5, 2015

This patch worked for me today. Thank you.

@kerrizor
Copy link
Collaborator

kerrizor commented Mar 5, 2015

Thanks! I'd love to get this in as an actual code change rather than a patch - anyone like to take this us as a PR?

@robert-baldwin
Copy link

Ran into this issue today. Patch fixed my issue.

@sstarr
Copy link

sstarr commented Apr 24, 2015

The patch fixed it for me too but now I get this error whenever I run my specs:

/Users/simon/.rubies/ruby-2.2.1/bin/ruby -I/Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib:/Users/simon/.gem/ruby/2.2.1/gems/rspec-support-3.1.2/lib /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
/Users/simon/.gem/ruby/2.2.1/gems/rails-erd-1.3.1/lib/rails_erd/domain/relationship/cardinality.rb:5:in `<class:Cardinality>': uninitialized constant RailsERD::Domain::Relationship::Cardinality::Inspectable (NameError)
    from /Users/simon/.gem/ruby/2.2.1/gems/rails-erd-1.3.1/lib/rails_erd/domain/relationship/cardinality.rb:4:in `<class:Relationship>'
    from /Users/simon/.gem/ruby/2.2.1/gems/rails-erd-1.3.1/lib/rails_erd/domain/relationship/cardinality.rb:3:in `<class:Domain>'
    from /Users/simon/.gem/ruby/2.2.1/gems/rails-erd-1.3.1/lib/rails_erd/domain/relationship/cardinality.rb:2:in `<module:RailsERD>'
    from /Users/simon/.gem/ruby/2.2.1/gems/rails-erd-1.3.1/lib/rails_erd/domain/relationship/cardinality.rb:1:in `<top (required)>'
    from /Users/simon/.gem/ruby/2.2.1/gems/rails-erd-1.3.1/lib/rails_erd/domain/relationship.rb:3:in `<top (required)>'
    from /Users/simon/Code/cahootify/config/initializers/rails_erd.rb:1:in `<top (required)>'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
    from /Users/simon/.gem/ruby/2.2.1/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:413:in `call'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /Users/simon/.rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/simon/.gem/ruby/2.2.1/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
    from /Users/simon/Code/cahootify/config/environment.rb:5:in `<top (required)>'
    from /Users/simon/Code/cahootify/spec/rails_helper.rb:4:in `require'
    from /Users/simon/Code/cahootify/spec/rails_helper.rb:4:in `<top (required)>'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1072:in `require'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1072:in `block in requires='
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1072:in `each'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1072:in `requires='
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration_options.rb:103:in `block in process_options_into'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration_options.rb:102:in `each'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration_options.rb:102:in `process_options_into'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/configuration_options.rb:22:in `configure'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:95:in `setup'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:84:in `run'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69:in `run'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37:in `invoke'
    from /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/exe/rspec:4:in `<main>'
/Users/simon/.rubies/ruby-2.2.1/bin/ruby -I/Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/lib:/Users/simon/.gem/ruby/2.2.1/gems/rspec-support-3.1.2/lib /Users/simon/.gem/ruby/2.2.1/gems/rspec-core-3.1.7/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

I've fixed it by scoping it to the development environment but it's pretty clunky:

if Rails.env.development?
  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
end

If anyone has a better solution I'd love to hear it :)

@kerrizor kerrizor added this to the 2.0 milestone May 15, 2015
@bigos
Copy link

bigos commented Jun 26, 2015

The patch let me generate a pdf file. Without it 'rake erd' woulf fail and 'dot' would crash on both Mac and Linux.

@cobbr2
Copy link

cobbr2 commented Nov 11, 2016

Using version 1.5.0 (which includes the merged PR #190), I still had the problem. Adding the @codez patch resolved it. Interestingly, it also solved it for https://github.com/amatsuda/erd on the same code-base. Fairly hairy model: 230 entities, lots of has-many-through and a fair smattering of polymorphic associations. Rails 3.2 with a load of patches; graphviz version 2.36.0 (20140111.2315)

@kerrizor
Copy link
Collaborator

@cobbr2 which version of graphviz are you on?

@cobbr2
Copy link

cobbr2 commented Nov 14, 2016

2.36.0

~/rails-erd$ dpkg -l | grep graphviz
ii  graphviz                                   2.36.0-0ubuntu3.1                     amd64        rich set of graph drawing tools

Oh, and of course it fixed the other gem; hadn't realized until then that it used rails-erd, since I'd installed them separately.

@jcw-
Copy link

jcw- commented Apr 27, 2017

Just had to use this 2014 patch to get things to generate, ideally it would work with those multiple relationships...

In my case it was complaining about Warning: flat edge between adjacent nodes one of which has a record shape - replace records with HTML-like labels even though everything seemed to be HTML.

graphviz 2.40.1

@mirelon
Copy link

mirelon commented Dec 4, 2017

rails-erd 1.5.2
dot 2.38.0

Still needed to apply this patch to make it work for User with invoice_address and correspondence_address as two links to the same model Address

@MarkMekhaiel
Copy link

@sstarr's fix worked for me - ruby 2.4.2 rails 5.1.4 ubuntu 18.04

@kerrizor
Copy link
Collaborator

Should be fixed by #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

Successfully merging a pull request may close this issue.