winston / google_visualr

A Ruby Gem for the Google Visualization API. Write Ruby code. Generate Javascript. Display a Google Chart.

Home Page:http://googlevisualr.heroku.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefine method to_js for nil class

ub2012 opened this issue · comments

I tried to reinstall gem google_visualr 2.1.5 but without ano effect
I have installerà ruby 1.9.2
Someone can help me?
Thanks

Error messages might be helpful.

The error message is
undefined method `to_js' for nil:NilClass

I wrote this into controller

def gauge

data_table = GoogleVisualr::DataTable.new
data_table.new_column('string' , 'Label')
data_table.new_column('number' , 'Value')
data_table.add_rows(3)
data_table.set_cell(0, 0, 'Memory' )
data_table.set_cell(0, 1, 80)
data_table.set_cell(1, 0, 'CPU' )
data_table.set_cell(1, 1, 55)
data_table.set_cell(2, 0, 'Network')
data_table.set_cell(2, 1, 68)

opts = { :width => 400, :height => 120, :redFrom => 90, :redTo => 100, :yellowFrom => 75, :yellowTo => 90, :minorTicks => 5 }
@Chart = GoogleVisualr::Interactive::Gauge.new(data_table, opts)

end

And i wrote this into view

<%= render_chart @Chart, 'chart' %>

The gem file is correctly bundled

The code seems alright to me. Does your view have a div with 'chart' as the id?

http://googlevisualr.herokuapp.com/examples/interactive/gauge

Yes, but during the copy/past it is not visible...i don't know why

May be' a conflict with anithe gem?
Anyway, thank for your help

Have you solved it?

Closing this ticket as I have reopened another ticket which has a similar issue.

#44