rake db:seed fails
fagiani opened this issue · 4 comments
On a pure ruby project using standalong-migrations
gem, after successfully running rake db:migrate
and having all migrations done, trying to get a standard seeds to fill a couple records shows the following error:
% rake db:seed
rake aborted!
NameError: uninitialized constant Post
/Users/myself/workspace/project/db/seeds.rb:1:in `<top (required)>'
I am not sure where it wants the Post
model class to be at.
Could anyone assist with a hint as even it might be obvious I've been browsing the code and was unable to figure that on my own.
Thanks a lot!
This seems to also be the case with rake db:drop
.
Sorry, I realized that in my Rakefile I was not loading my app's environment.
Since this project is mainly used for others without Rails, do you need more require
s to load the Post model anywhere?
Close an old issue?
Good call, going to close this issue due to age. If it's still a problem let me know and I can re-open it.