Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRoy Huang
4,367 PointsUninitialized constant Post
Hello I was taking the course and trying to build a simple blog. It was fine to do
Post.create(title: "....", body: "....") in IRB
However, the second time I would like to make more posts for test as in the video, it told me "NameError: uninitialized constant Post"
I have done everything the video told me to, could someone tell me why does this happen?
Thanks in advance.
1 Answer
Adam Sackfield
Courses Plus Student 19,663 PointsThat error is telling you that you have no model called Post. Ensure you have not mistyped the name of the model, or even named it 'Posts' or 'posts'.
thisandthat
3,220 Pointsthisandthat
3,220 PointsWhat is the output in the console look like?