kale
kale

Reputation: 1261

Error when using gchart (googlecharts) gem - NameError: uninitialized constant Gchart

http://googlecharts.rubyforge.org/

I installed it with: sudo gem install googlecharts

It installed fine, but whenever I try to use it I get: NameError: uninitialized constant Gchart

Here is the code I am running:

$ irb
>> require 'gchart'
=> true
>> Gchart.line(:data => [0, 40, 10, 70, 20])
NameError: uninitialized constant Gchart
    from (irb):2

Upvotes: 5

Views: 1027

Answers (1)

Colonel Panic
Colonel Panic

Reputation: 137492

Kale, I had this problem too. There's another gem called gchart which conflicts with googlecharts as they both use the name 'gchart' in Ruby. You need to uninstall gchart: gem uninstall gchart and potentially reinstall googlecharts.

Upvotes: 3

Related Questions