# Rails error on generated app

**URL:** <https://www.ruby-forum.com/t/rails-error-on-generated-app/112159>\
**Category:** Rails\
**Created:** [August 15, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/rails-error-on-generated-app/112159 "2007-08-15T23:48:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sloppy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@sloppy](https://www.ruby-forum.com/u/sloppy)\
**Post date:** [August 15, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/rails-error-on-generated-app/112159/1 "2007-08-15T23:48:57Z")

</div>

I created a very simple app with a database table for image file names  
and tags to be associated with the image. When I generate the  
scaffolded app it has an error in it. There is an uninitialized  
constant of the same name as the model class but singular instead of  
plural. I.E. Model class Photos \< ActiveRecord::Base and in the  
completely generated app I get an error when creating a row in the db  
for an “uninitialized constant Photo”. I can;lt find photo in the  
generated cod via fgrep. I’m at a loss.

I followed these steps

- rails gallery
- cd gallery/
- 
# create a gallery\_development schema using MySQL Query browser
- script/generate migration photos
- 
# edit the migration file to create the empty table
- rake migrate
- 
# checked the database and “photos” table looks correct
- script/generate scaffold photos photos
- script.server

Now comes the weird part when I go to: locahost:3000/photos I get this  
error message:

NameError in PhotosController#index

uninitialized constant Photo

RAILS\_ROOT: script/…/config/…  
Application Trace | Framework Trace | Full Trace
