Forum: Ruby on Rails Gruff on Windows

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff7c968ec96d769974df09dc453eb746?d=identicon&s=25 Sean Blezard (Guest)
on 2006-04-14 22:03
(Received via mailing list)
Has anyone achieved a stable deployment of Gruff with Rmagick on
Windows?
I've been playing around with this on Instant Rails and after installing
the
RMagick win 32 gem (local gem install as per instructions on web) and
then
Gruff on top of that. I did a test controller method that rendered the
fruit
pie chart as per the examples on the gruff site. This worked. However,
when
I refreshed the page again my whole SCGI session crashed spectacularly -
unable to compile *any* pages etc.

Here is the reference code in question:

      require 'RMagick'
      require 'gruff'
      g = Gruff::Line.new
      g.title = "My Graph"
      g.data("Apples", [1, 2, 3, 4, 4, 3])
      g.data("Oranges", [4, 8, 7, 9, 8, 9])
      g.data("Watermelon", [2, 3, 1, 5, 6, 8])
      g.data("Peaches", [9, 9, 10, 8, 7, 9])
      g.labels = {0 => '2003', 2 => '2004', 4 => '2005'}
      send_data(g.to_blob,
            :disposition => 'inline',
            :type => 'image/png',
            :filename => "chart.png")

Firstly, does this code look right for a controller method? Secondly,
should
this work at all on Windows? In a separate rhtml page i had a simple
<img
src> tag that references this controller method.

Thanks for any help...

Sean.
This topic is locked and can not be replied to.