Problems with using Open Flash Charts library

I have download OpenFlashCharts library for RubyonRails.
And when I try to make a chart a have problem with data for this chart
code samples from examples which are on this web-site are'nt working

for example

def piechart
  @graph = open_flash_chart_object(500,250, '/projects/pie', false,
  def pie
        data = []
        5.times do |t|
                data << rand(10) + 5

        g =
        g.pie(60, '#505050', '#000000')
        g.pie_values(data, %w(IE FireFox Opera Wii Other))
        g.pie_slice_colors(%w(#d01fc3 #356aa0 #c79810))
        g.title("Pie Chart", '{font-size:18px; color: #d01f3c}' )
        render :text => g.render

dont draw me a chart but when I put data for chart to
this script draw me chart
but problem is in that data must be generated automatically without
putting data in another file.

Thanks for replies.