Ruby-Graphviz does not render png
I just tried the ruby-graphviz gem (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 am not able to render any output image (png,dot).
# Create a new graph
g = GraphV开发者_如何学JAVAiz.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 the skript from the console I get no error message but also no output as expected.
What could be the problem? Folders have read/write access for everybody.
Thanks in advance. By the way, I´m working on a Mac (Leopard 10.6).
Installing graphviz via MacPorts did the trick:
sudo port install graphviz
The installation process could take a while, but then the above mentioned example should work.
What I did was following the link to the "Mac OS X edition of Graphviz" on http://graphviz.org. I installed the software and thought everything was fine. That´s kind of confusing.
精彩评论