Ruby-Graphviz does not display png

I just tried the gem of ruby-graphviz ( http://github.com/glejeune/Ruby-Graphviz ). I followed the instructions (installed Graphviz, gem and dependencies) and tried the example from the Github page. Unfortunately, I cannot display any output image (png, dot).

# Create a new graph
g = GraphViz.new( :G, :type => :digraph )

# Create two nodes
hello = g.add_node( "Hello" )
world = g.add_node( "World" )

# Create an edge between the two nodes
g.add_edge( hello, world )

# Generate output image
g.output( :png => "hello_world.png" )

When I run skript from the console, I do not receive an error message, but also do not display as expected.

What could be the problem? Folders have read / write access for everyone.

Thanks in advance. By the way, I'm working on a Mac (Leopard 10.6).

+3
source share
1 answer

Installing Graphviz through MacPorts did the trick:

sudo port install graphviz

, .

Mac OS X edition of Graphviz http://graphviz.org. , . .

+2

Source: https://habr.com/ru/post/1745005/


All Articles