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 trialAlexander Ramadan
3,283 PointsNoMethodError in Devise/registrations#new error
I'm at the point where I am trying to access 'users/sign_up' but I am getting the a 'NoMethodError in Devise/registrations#new' error. I get this on all the new paths I've checked.
I've run "rake db:rollback" and then "rake db:migrate" to try to fix it but that doesn't seem to work.
Any help?
10 Answers
Nina Selezneva
432 PointsGot the same issue like you, Alexander! It seems that you need to reboot rails server to append the changes - at least worked for me. Have you tried that?
jmt
13,877 Pointstry "rake db:reset"
Alexander Ramadan
3,283 PointsNo luck, getting the same error.
More of the error if it helps,
Showing /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-2.1.2/app/views/devise/registrations/new.html.erb where line #3 raised:
undefined method `registration_path' for #<#<Class:0x007fc48b855f28>:0x007fc48baf6368> Extracted source (around line #3):
1: <h2>Sign up</h2> 2: 3: <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> 4: <%= devise_error_messages! %> 5: 6: <div><%= f.label :email %><br />
Is there an order I should run them in, "reset", "rollback", and "migrate" that is.
jmt
13,877 PointsHmm...I'm not sure, I had this issue for a while as well, "rake db:reset" finally fixed it for me.
Also, I don't know if this would matter, but is your "Sign Up" inside the header tags?
<h1></h1>
Luke Ward
9,154 PointsHave you tried rake routes to see the actual route of the page? Have you edited anything in your routes.rb?
Alexander Ramadan
3,283 PointsYep, ran rake routes. I haven't changed anything in routes.rb that I wasn't instructed to. Ill double check though.
Luke Ward
9,154 PointsHave you ran generate devise views?
Alexander Ramadan
3,283 PointsYes, would I need to run it again after db:reset or db:rollback?
When I run rake routes I can see all the views like /users/sign_up
Alexander Ramadan
3,283 PointsOkay, I don't know what happened but when I booted up this evening everything seems to be working.
Thanks for the help!
Aditia Lukman Ernawan
8,847 PointsI found it works by using
rake db:rollback and rake db:reset up until your table is cleared, then migrate it again using rake db:migrate
Cheers