benzelano / test_lh_import

1 stars 0 forks source link

problems running graphviz #112

Closed benzelano closed 13 years ago

benzelano commented 13 years ago

Pete Forde opened this issue

I’ve installed the graphviz darwin package, and the graphviz-ruby gem.

I created a very simple class to test the state_machine:draw:rails functionality, and this is what I get:

pete ~/quotesys (edge)$ rake state_machine:draw:rails CLASS=Booking
(in /Users/pete/quotesys)
  SQL (0.4ms)   SET SQL_AUTO_IS_NULL=0
  SQL (0.6ms)   SHOW TABLES
  SQL (0.2ms)   SELECT version FROM schema_migrations
  Global Columns (3.5ms)   SHOW FIELDS FROM `globals`
  SQL (0.1ms)   BEGIN
  SQL (0.2ms)   SELECT count(*) AS count_all FROM `globals` 
  SQL (0.1ms)   ROLLBACK
Warning: node ’released’, graph ’G’ size too small for label
Warning: node ’production’, graph ’G’ size too small for label
Warning: node ’installation’, graph ’G’ size too small for label
Warning: node ’installed’, graph ’G’ size too small for label
Warning: node ’never_booked’, graph ’G’ size too small for label
Warning: node ’never_produced’, graph ’G’ size too small for label
Warning: node ’never_installed’, graph ’G’ size too small for label
Warning: node ’never_removed’, graph ’G’ size too small for label
dyld: lazy symbol binding failed: Symbol not found: _pixman_image_create_bits
  Referenced from: /usr/local/lib/graphviz/libgvplugin_pango.5.dylib
  Expected in: flat namespace

dyld: Symbol not found: _pixman_image_create_bits
  Referenced from: /usr/local/lib/graphviz/libgvplugin_pango.5.dylib
  Expected in: flat namespace

original LH ticket

This ticket has 5 attachment(s).

benzelano commented 13 years ago

Sounds like a problem with the Darwin package. A quick Google search reveals the following: http://blog.grogmaster.com/2008/12/installing-graphziv-on-mac-os-x.html

Can you try following those instructions and seeing if it fixes the problem? Unfortunately, I don’t have access to a Mac.

benzelano commented 13 years ago

Pete Forde commented

Hey Aaron,

You nailed it. Sorry for troubling you with this; that said, between the darwin issue and the rake tasks not working, I suspect that I’m the only one who’s used this functionality.

At any rate, I got it going, and it generally works well.

benzelano commented 13 years ago

Admittedly I’ve only generated graphs by running the rake task from the root library folder or by calling #draw directly on the state machine from the Rails console.

Thanks for the bug report, though... I’m sure it’ll help others who run into the same problem.

I’ll have to see if I can improve the readability of some of those states.

benzelano commented 13 years ago

I’ve tweaked the drawing algorithm a bit to accommodate states with long names: http://github.com/pluginaweek/state_machine/commit/d6fbdcc10127ab166c13628f12fd6c6e81ccf5cf

Hopefully this’ll generate slightly more readable graphs in the future. I’ve attached the graph that’s generated based on the Booking class provided in the ticket.

benzelano commented 13 years ago

Pete Forde commented

That’s awesome, Aaron!

Huge improvement.