# Missing models after generating an Engine

**URL:** <https://www.ruby-forum.com/t/missing-models-after-generating-an-engine/100756>\
**Category:** Engines\
**Created:** [July 31, 2006, 10:44pm UTC](https://www.ruby-forum.com/t/missing-models-after-generating-an-engine/100756 "2006-07-31T22:44:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [July 31, 2006, 10:44pm UTC](https://www.ruby-forum.com/t/missing-models-after-generating-an-engine/100756/1 "2006-07-31T22:44:12Z")

</div>

Hi all !

I am extracting chunks of code into engines from an existing app. One  
model I’m extracting is Recipient.

I followed the LoginEngine convention:

app/models/recipient.rb:  
class Recipient \< AR::Base  
include XlPop::Recipient  
end

lib/xl\_pop/recipient.rb  
module XlPop  
module Recipient  
def self.included(base)  
base.send :include, XlPop::Recipient::InstanceMethods  
base.send :extend, XlPop::Recipient::ClassMethods  
base.validates\_presence\_of …  
end

```
module ClassMethods
  ...
end

module InstanceMethods
  ...
end

```

end  
end

The other models I extracted worked correctly, but loading Recipient  
complains:

$ ruby script\console  
Loading development environment.  
./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:123:in  
`const\_missing’:NameError: uninitialized constant Recipient

> >

I added some code to  
vendor/rails/activesupport/lib/active\_support/dependencies.rb to show  
me what files were loaded and the load path at that time. I noticed  
that vendor/plugins/xl\_pop/app/models is NOT in the load path. Is  
that to be expected ?

I did try creating my model in app/models, and it works. So, I am  
inclined to think the missing models directory in the load path is the  
problem.

Thanks all !

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [August 3, 2006, 2:24pm UTC](https://www.ruby-forum.com/t/missing-models-after-generating-an-engine/100756/2 "2006-08-03T14:24:43Z")

</div>

Are you definitely ‘starting’ the engine?
