# Generate model error

**URL:** <https://www.ruby-forum.com/t/generate-model-error/176148>\
**Category:** Rails\
**Created:** [September 25, 2009, 10:18am UTC](https://www.ruby-forum.com/t/generate-model-error/176148 "2009-09-25T10:18:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guwenqign](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@guwenqign](https://www.ruby-forum.com/u/guwenqign)\
**Post date:** [September 25, 2009, 10:18am UTC](https://www.ruby-forum.com/t/generate-model-error/176148/1 "2009-09-25T10:18:46Z")

</div>

I’m new on rails, and I encountered a problem when I am doing a  
tutorial: that’s a simple application without a database.

First “rails simple\_app”  
And modify “enviroment.rb”

# Skip frameworks you’re not going to use. To use Rails without a

database,

# you must remove the Active Record framework.

config.frameworks -= [ :active\_record, :active\_resource,  
:action\_mailer ]

However, after that when I execute the command “ruby script/generate  
model Item” there will be an error raised:  
uninitialized constant ModelGenerator::ActiveRecord

Anyone knows the origin of the problem, and how to solve it

BTW: I am using rails 2.3.4 and ruby 1.8.7

---

<div class="post-metadata">

**Author:** ![guwenqign](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@guwenqign](https://www.ruby-forum.com/u/guwenqign)\
**Post date:** [September 25, 2009, 10:41am UTC](https://www.ruby-forum.com/t/generate-model-error/176148/2 "2009-09-25T10:41:08Z")

</div>

2009/9/25 Wenqing Gu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Â config.frameworks -= [ :active\_record, :active\_resource,  
> :action\_mailer ]
> 
> However, after that when I execute the command “ruby script/generate  
> model Item” there will be an error raised:  
> uninitialized constant ModelGenerator::ActiveRecord
> 
> Anyone knows the origin of the problem, and how to solve it

I may be wrong ( I often am ) but I would guess that the Model  
generator assumes that you are using ActiveRecord. It does generate  
migrations after all.

Unless you really want to use Rails without a db then I would give it  
one. You do not have to do anything with it in your first forays,  
just make it available to keep Rails happy.

Colin
