# Plugin Problems: const\_missing: uninitialized constant Rails

**URL:** <https://www.ruby-forum.com/t/plugin-problems-const-missing-uninitialized-constant-rails/109674>\
**Category:** Rails\
**Created:** [July 17, 2007, 7:23pm UTC](https://www.ruby-forum.com/t/plugin-problems-const-missing-uninitialized-constant-rails/109674 "2007-07-17T19:23:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maraby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f08c70/32.png) [@maraby](https://www.ruby-forum.com/u/maraby)\
**Post date:** [July 17, 2007, 7:23pm UTC](https://www.ruby-forum.com/t/plugin-problems-const-missing-uninitialized-constant-rails/109674/1 "2007-07-17T19:23:54Z")

</div>

I’m receiving this error when I try to start Mongrel on my local  
machine. I’ve checked my Rails, Rake, and Gem versions, as well as all  
of the other gems I’m using.

[http://pastie.caboo.se/79503](http://pastie.caboo.se/79503)

The situation is that I simply started an empty Rails app and  
generated an empty plugin. I added the plugin into the  
ActionView::Base class in init.rb and really only added one empty  
method to the plugin.

There is a controller and the routes have been set up to default to  
the bare-bones controller’s action index.

I do not get the error if I disable the plugin from loading, but if it  
is not disabled, I get this error and Mongrel fails to load.

I doublechecked all of my naming and I don’t see any duplicate names.

If anybody could give me any substantive leads in which way to address  
this issue, I’d appreciate it. I just haven’t found much help via  
Google, Google G., wikis, or in IRC regarding this issue, or  
plugins in general.

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![maraby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f08c70/32.png) [@maraby](https://www.ruby-forum.com/u/maraby)\
**Post date:** [July 17, 2007, 8:38pm UTC](https://www.ruby-forum.com/t/plugin-problems-const-missing-uninitialized-constant-rails/109674/2 "2007-07-17T20:38:13Z")

</div>

After further experimentation, the error occurs when I execute the  
init.rb file:

ActionView::Base.send :include, CalendarHelper

I tried experimenting with :extend, with changing the CalendarHelper  
to class and back, and nothing appears to change the error. It appears  
to be an error with how it is being added into the Rails::Initializer  
module…

Help!

---

<div class="post-metadata">

**Author:** ![maraby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f08c70/32.png) [@maraby](https://www.ruby-forum.com/u/maraby)\
**Post date:** [July 17, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/plugin-problems-const-missing-uninitialized-constant-rails/109674/3 "2007-07-17T22:30:32Z")

</div>

It appears the problem was simply that I was not requring in the  
library file, which I assumed was being done automatically. Whoops.

init.rb ----------------

require ‘calendar’  
ActionView::Base.send :include, CalendarHelper
