0

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)

8
  • What do the Rails log show? Commented Sep 14, 2014 at 12:36
  • can you post registerations controller and logs when you submit sign up form? Commented Sep 14, 2014 at 12:51
  • 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? Commented Sep 14, 2014 at 15:11
  • @Jensky do you have any custom validations? Do you have flash messages to show validation errors? Commented Sep 14, 2014 at 16:00
  • 1
    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. Commented Sep 14, 2014 at 19:34

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Can you show me a context or a little more verbose code? I'm beginner and I've never used method like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.