# Is engines broken in Rails 1.2.3?

**URL:** <https://www.ruby-forum.com/t/is-engines-broken-in-rails-1-2-3/110594>\
**Category:** Engines\
**Created:** [July 27, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/is-engines-broken-in-rails-1-2-3/110594 "2007-07-27T22:31:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [July 27, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/is-engines-broken-in-rails-1-2-3/110594/1 "2007-07-27T22:31:57Z")

</div>

A few hours ago I factored out one of my AR models that I’d be reusing  
into a minimalist plugin. I copied the model into the plugin’s lib/,  
added a line to init.rb to load it, and the model was now present in the  
console.

The next step was to move the model’s controller and views into the  
plugin. Engines seemed like the way to go, since that’s exactly what  
it’s for. So I install the Engines plugin per the site’s instructions.

I follow Gwyn’s tutorial step by step: I create an app/ hierarchy at the  
top level of my plugin, I empty out my init.rb because that’s what he  
does in Macaque. I move my model into the plugin’s app/models. I restart  
my console and I get this:

> > Geo.find(1)  
> > LoadError: Expected ./script/…/config/…/config/…/app/models/geo.rb to  
> > define  
> > Geo  
> > from  
> > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib  
> > /active\_support/dependencies.rb:249:in `load_missing_constant' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib /active_support/dependencies.rb:452:in`const\_missing’  
> > from  
> > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib  
> > /active\_support/dependencies.rb:464:in `const\_missing’  
> > from (irb):3
> 
> >

I can get at all my other (non-plugin) classes just fine, but this one?  
No dice. Both Engines and my plugin show up in Rails.plugins, and the  
output shows that it’s being seen as an engine in that it has model,  
controller and view paths. My development log shows the engines plugin  
loading first and this and my other plugins loading with engines  
extensions.

I know Engines is broken in Edge, but is it also broken in the current  
1.2.3 release? If it isn’t, I’ll be glad to dig deeper and paste in my  
plugin’s whole directory and file layout, etc.

---

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [July 30, 2007, 4:11pm UTC](https://www.ruby-forum.com/t/is-engines-broken-in-rails-1-2-3/110594/2 "2007-07-30T16:11:12Z")

</div>

Solved it myself. I had to delete my app’s app/models/geo.rb from the  
filesystem even though I had the entire contents commented out. Rails  
was probably loading it after my engine’s version, wiping out the  
definition.

Steve K. wrote:  
…

> I follow Gwyn’s tutorial step by step: I create an app/ hierarchy at the  
> top level of my plugin, I empty out my init.rb because that’s what he  
> does in Macaque. I move my model into the plugin’s app/models. I restart  
> my console and I get this:
> 
> > > Geo.find(1)  
> > > LoadError: Expected ./script/…/config/…/config/…/app/models/geo.rb to  
> > > define  
> > > Geo  
> > > from  
> > > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib  
> > > /active\_support/dependencies.rb:249:in `load_missing_constant' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib /active_support/dependencies.rb:452:in`const\_missing’  
> > > from  
> > > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib  
> > > /active\_support/dependencies.rb:464:in `const\_missing’  
> > > from (irb):3
> > 
> > >
> 
> I can get at all my other (non-plugin) classes just fine, but this one?  
> No dice. Both Engines and my plugin show up in Rails.plugins, and the  
> output shows that it’s being seen as an engine in that it has model,  
> controller and view paths. My development log shows the engines plugin  
> loading first and this and my other plugins loading with engines  
> extensions.  
> …
