# Unitialized constant

**URL:** <https://www.ruby-forum.com/t/unitialized-constant/186117>\
**Category:** Rails\
**Created:** [March 31, 2010, 7:49pm UTC](https://www.ruby-forum.com/t/unitialized-constant/186117 "2010-03-31T19:49:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [March 31, 2010, 7:49pm UTC](https://www.ruby-forum.com/t/unitialized-constant/186117/1 "2010-03-31T19:49:03Z")

</div>

I installed this plugin [GitHub - loudpixel/highcharts-rails: A plugin for displaying Highcharts graphs in Rails](http://github.com/loudpixel/highcharts-rails)  
and I put this code in my controller:

def panels  
@ui\_panels = Highchart.pie({  
:chart =\> {  
:renderTo =\> “pie-chart-container”,  
:margin =\> [50, 30, 0, 30]  
},  
:credits =\> {  
:enabled =\> true,  
:href =\> ‘[Market share for mobile, browsers, operating systems and search engines | NetMarketShare](http://marketshare.hitslink.com/browser) â€¦  
px?qprid=3’,  
:text =\> ‘Data provided by NETMARKETSHARE’  
},  
:plotOptions =\> {  
:pie =\> {  
:dataLabels =\> {  
:formatter =\> pie\_label\_formatter,  
:style =\> {  
:textShadow =\> ‘#000000 1px 1px 2px’  
}  
}  
}  
},  
:series =\> [  
{  
:type =\> ‘pie’,  
:data =\> browser\_data  
}  
],  
:subtitle =\> {  
:text =\> ‘January 2010’  
},  
:title =\> {  
:text =\> ‘Browser Market Share’  
},  
:tooltip =\> {  
:formatter =\> pie\_tooltip\_formatter  
},  
})

end

Yet, I get this error:  
NameError in DashboardController#panels

uninitialized constant DashboardController::Highchart

Any suggestions? thanks.

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [March 31, 2010, 8:10pm UTC](https://www.ruby-forum.com/t/unitialized-constant/186117/2 "2010-03-31T20:10:55Z")

</div>

> uninitialized constant DashboardController::Highchart
> 
> Any suggestions? thanks.

Are you able to go into the console and just type Highchart ? See if  
it’s actually getting loaded into your app. If so, have you tried using  
the scope operator :: in front of it?

~Jeremy

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [March 31, 2010, 8:45pm UTC](https://www.ruby-forum.com/t/unitialized-constant/186117/3 "2010-03-31T20:45:01Z")

</div>

Did you run the rake task after you installed the plugin?

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [March 31, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/unitialized-constant/186117/4 "2010-03-31T21:54:31Z")

</div>

David wrote:

> Did you run the rake task after you installed the plugin?

Yeah, I ran  
rake highcharts\_rails:install  
and then  
rake db:migrate

in console, I get this:

> > HighChart  
> > NameError: uninitialized constant HighChart  
> > from  
> > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active\_support/dependencies.rb:443:in  
> > `load_missing_constant' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in`const\_missing’  
> > from  
> > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active\_support/dependencies.rb:92:in  
> > `const\_missing’  
> > from (irb):4
