Unable to recognize model - uninitialized constant Model

I don't know the direct answer to your problem, but I think the best
way to run scripts within the environment of an application is to use
rake, then it should all be handled for you. That is what rake is