0
votes

I configure Devise gem for Rails and in code it seems look OK but when I'm trying to register new user I have the problem. In register form Devise show notice:

Please review the problems below:

but that's all. Nothing specific message. Where I should looking for first? How to debug something like this? Any suggestions?

Log from rails server:

Started POST "/auth/register" for 127.0.0.1 at 2014-09-14 17:09:13 +0200 Processing by Devise::RegistrationsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"iRsLU68tBckSzK1tupMoXZQlGw7xOuzMlfuiIVVs+rc=", "user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
(0.2ms) BEGIN User Exists (0.4ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '[email protected]' LIMIT 1 (0.2ms) ROLLBACK
Rendered devise/shared/_links.haml (0.5ms) Rendered devise/registrations/new.html.haml within layouts/application (15.9ms) Completed 200 OK in 121ms (Views: 24.2ms | ActiveRecord: 0.8ms)

And when I try log in:

Started POST "/auth/login" for 127.0.0.1 at 2014-09-14 17:10:23 +0200 Processing by Devise::SessionsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"iRsLU68tBckSzK1tupMoXZQlGw7xOuzMlfuiIVVs+rc=", "user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"} User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."email" = '[email protected]' ORDER BY "users"."id" ASC LIMIT 1 Completed 401 Unauthorized in 2ms Processing by Devise::SessionsController#new as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"iRsLU68tBckSzK1tupMoXZQlGw7xOuzMlfuiIVVs+rc=", "user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"} Rendered devise/shared/_links.haml (0.4ms) Rendered devise/sessions/new.html.haml within layouts/application (9.8ms) Completed 200 OK in 106ms (Views: 15.4ms | ActiveRecord: 0.0ms)

1
What do the Rails log show?Martin Poulsen
can you post registerations controller and logs when you submit sign up form?Mandeep
I added log but I don't know how should I read it. Can you give me some advices about reading this log from server console?Jensky
@Jensky do you have any custom validations? Do you have flash messages to show validation errors?Mandeep
Try to create a user in console. rails c u = User.new("email"=>"[email protected]", "password"=>"<enter something here>", "password_confirmation"=>"<enter something here>"). Then you can see if it saves or errors. You can inspect u.errors here.Mark Swardstrom

1 Answers

1
votes

I debug these things by inspecting the object.errors

In this case, try to

raise @user.errors.inspect

Somewhere after the save in the create method