# Uninitialized constant error

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-error/70774>\
**Category:** Rails\
**Created:** [February 20, 2006, 10:00am UTC](https://www.ruby-forum.com/t/uninitialized-constant-error/70774 "2006-02-20T10:00:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjcharl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@mjcharl](https://www.ruby-forum.com/u/mjcharl)\
**Post date:** [February 20, 2006, 10:00am UTC](https://www.ruby-forum.com/t/uninitialized-constant-error/70774/1 "2006-02-20T10:00:26Z")

</div>

Hi,

On Saturday I installed Ruby 1.8.2, Rails 1.0.0 and MySql 5.0.18 on a  
new laptop running Windows XP home. I used Gem to install Rails. Gem  
came packaged with Rails in the standard download from  
[www.rubyonrails.org](http://www.rubyonrails.org).

I put together an app using scaffold and everything worked fine.

Last night (Sunday) I attempted to add in Login functionality. I was  
going to code thing by hand but noticed that there is a Login generator  
available. I installed int with gem install login\_generator. I updated  
the users table in my database to match the Login generator schema and  
ran script/generate login to create a Login controller. I had no errors  
during this process.

After doing the above, actions that had been working now give an error  
saying unitialized constant xyz where xyz is the name of the model. I  
reinstalled various bits and pieces and nothing worked so eventually I  
re-imaged the whole machine and built it from scratch, just to make sure  
that noting had been left lying around. I did a simple generate against  
a table called users with columns for id and name. Everything seemed to  
generate OK but when I run the app I get the same problem.

I can’t think of what might be wrong. The only posibility seems to be  
some change in the dependencies that are picked when I do gen install  
rails --include-dependencies.

Has anyone else experienced this or something similar?

Any suggestions would be most welcome.

I can supply the exact error message later if required, when I get in  
from work.

Thanks,

Martin

---

<div class="post-metadata">

**Author:** ![mjcharl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@mjcharl](https://www.ruby-forum.com/u/mjcharl)\
**Post date:** [February 20, 2006, 12:26pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error/70774/2 "2006-02-20T12:26:29Z")

</div>

> After doing the above, actions that had been working now give an error  
> saying unitialized constant xyz where xyz is the name of the model.

Can you post the code?

-T

---

<div class="post-metadata">

**Author:** ![mjcharl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@mjcharl](https://www.ruby-forum.com/u/mjcharl)\
**Post date:** [February 20, 2006, 12:58pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error/70774/3 "2006-02-20T12:58:34Z")

</div>

Hi Anthony,

Yes I can but not until tonight as my Laptop is at home. I will post  
the code and the whole stack trace.

Regards,

Martin

---

<div class="post-metadata">

**Author:** ![mjcharl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@mjcharl](https://www.ruby-forum.com/u/mjcharl)\
**Post date:** [February 20, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-error/70774/4 "2006-02-20T18:41:26Z")

</div>

Hi Anthony,

I’ve just done a gem update and that seems to have fixed things.

Thanks for responding to my question though.

Regards,

Martin
