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!

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

Ruby Build a Simple Ruby on Rails Application Creating an Authentication System Generating the Devise Views

Simple Rails App - Devise Issue

I am receiving this error ActiveRecord::StatementInvalid in Devise::RegistrationsController#new. I know the video is out of date with a few things, but not sure if this is the cause. Any help would be appreciated. When I run rake db:migrate:status it only shows one migration even though I created a migration for Devise User.

4 Answers

I figured it out by opening up the provided files and comparing them to mine. For some reason there was no users table in the schema.rb file so I copied it over and rake db:migrate. Also my devise_create_users migration did not end it .rb, not sure why but I added that. The combination of these two seemed to get it working, not exactly sure how or why this happened but it's good now.

Stone Preston
Stone Preston
42,016 Points

have you tried running just

$ rake d:migrate

it sounds like your registrations controller might not have a "new" action. can you check your controller and make sure you have that action defined?

Hi Stone,

Thanks for responding. I have tried rake db:migrate, also tried dropping and recreating. As far as a registrations controller, I have been following the videos I installed Devise and generated a User model. At this point I only have a statuses_controller. When I installed Devise was it supposed to generate a controller at some point? Maybe that is the problem? I am pretty new to rails, so if my logic doesn't make sense forgive me. Thanks for the help.

David Curtis
David Curtis
11,301 Points

Not sure if this is the same issue I had with devise, but here is a lengthy post on issues with devise: https://teamtreehouse.com/forum/devise-updated-with-ruby-211-and-rails-403

When devise started getting buggy with me, I started the course over w/ 1.9.3 (instead of 2.0 and 4.0 rails). Hopefully, you won't have to do that.

Good luck -