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 trial
James Bullis
12,762 PointsWrite a Test -> Fixtures -> Error
While going through the Fixtures module I came up with a similar error as in the video at 1:32:
SQLite3::SQLException: table users has no column named password: INSERT INTO "users"
I'm stuck and I don't know what to do. I have scoured my code and I can't figure out why I can't get it to pass the test after I finished the module. Check out my code at my commit below.
https://github.com/jmbullis/treebook/commit/fbbb7f210e5b6de641c52ecd91d4c02d0bcb7d94
9 Answers
Jason Seifer
Treehouse Guest TeacherHey James, try taking out the "password" and "password_confirmation" lines in the users.yml file?
Michael Dawson
Courses Plus Student 2,719 PointsI'm doing the Ruby project, but haven't done a fixtures module, but the first thing that comes to my mind is that the indentation may be wrong in your users.yml file. Use two spaces instead of a tab and see if that makes a difference. yml files are sensitive to indenting I believe :)
James Bullis
12,762 PointsI initially had tabs but read it could cause this problem. I have checked my spacing and indentation in all of these files. I took out the spaces on the yml file and dropped it to just one space and am still getting the same errors. I got a feeling I have something out of syntax but it all looks correct to me.
Matthew Hartwig
3,941 Points.yml requires 2 spaces for model attributes
also when in doubt try:
rake db:create:all
rake db:migrate
and if you're testing:
rake db:test:prepare
James Bullis
12,762 PointsI'm testing. Had already tried to rebuild the db. But went ahead and did
rake db:test:prepare
and still getting the same errors. I guess I will go back through the transcripts today to see if I missed a step.
James Bullis
12,762 PointsHey Jason, Merry Christmas.
I took these out and was able to get the tests to pass.
I think the reason is because the database encrypts the passwords and the schema shows encrypted password and not password. If I use encrypted_password it works.
Jason Seifer
Treehouse Guest TeacherThat's correct, James!
Wilson Usman
35,206 PointsWhy is it different in the tutorial?
Daniel Beere
3,524 PointsHi James,
What way did you use encrypted_password?
James Bullis
12,762 PointsI actually don't remember. Once I fixed this I came about a few other errors. I decided I would start over on the whole Ruby segment and tackle this while completing the developer adventure.