Forum: Ruby on Rails Uninitialized constant error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin C. (Guest)
on 2006-02-20 11:00
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.

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
Anthony G. (Guest)
on 2006-02-20 13:26
> 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
Martin C. (Guest)
on 2006-02-20 13:58
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
Martin C. (Guest)
on 2006-02-20 19:41
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
This topic is locked and can not be replied to.