Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7903467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:45:39+00:00 2026-06-03T09:45:39+00:00

I am trying to set-up a two step signup process using Devise in Rails

  • 0

I am trying to set-up a two step signup process using Devise in Rails and followed this tutorial by Claudio Marai.
When I enter the e-mail address in the form (first step), I get an error telling me there was a routing error and that it couldn’t find RegistrationsController

Started POST "/users" for 127.0.0.1 at 2012-05-03 22:50:59 -0400

ActionController::RoutingError (uninitialized constant RegistrationsController):
  activesupport (3.2.1) lib/active_support/inflector/methods.rb:229:in `block in constantize'
  activesupport (3.2.1) lib/active_support/inflector/methods.rb:228:in `each'
  activesupport (3.2.1) lib/active_support/inflector/methods.rb:228:in `constantize'
  .
  .
  .

I figured this was due to the presence of :registrations => "registrations" in my routes.rb file as described in the first step of the tutorial. I then tried two alternatives which both resulted in the same error. First, I removed the :registrations => "registrations" from the routes.rb file. When that didn’t work, I re-inserted the line and added a registrations_controller.rb to the controllers directory which looked like this:

class RegistrationsController < Devise::RegistrationsController
end

I figured the two options would have the same effect – but – I tried them anyway.

The error I got was the following:

Started POST "/users" for 127.0.0.1 at 2012-05-03 22:47:29 -0400
Processing by Devise::RegistrationsController#create as HTML
  Parameters: {"utf8"=>"?", "authenticity_token"=>"ttPBRPRLVzPBHcDDKRJbimv0Yp/egdK5qBkIvBTL4Ig=", "user"=>{"email"=>"test@email.com"}, "x"=>"0", "y"=>"0"}
   (0.6ms)  begin transaction
  User Exists (1.5ms)  SELECT 1 FROM "users" WHERE "users"."email" = 'test@email.com' LIMIT 1
  CACHE (0.0ms)  SELECT 1 FROM "users" WHERE "users"."email" = 'test@email.com' LIMIT 1
  User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = '8tA1jakpAXNK4Piz7J6R' LIMIT 1
  SQL (14.0ms)  INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "fb_id", "fb_token", "first_name", "last_name", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "state", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [["confirmation_sent_at", Thu, 03 May 2012 22:47:30 EDT -04:00], ["confirmation_token", "8tA1jakpAXNK4Piz7J6R"], ["confirmed_at", nil], ["created_at", Thu, 03 May 2012 22:47:30 EDT -04:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "test@email.com"], ["encrypted_password", nil], ["fb_id", nil], ["fb_token", nil], ["first_name", nil], ["last_name", nil], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["sign_in_count", 0], ["state", nil], ["updated_at", Thu, 03 May 2012 22:47:30 EDT -04:00]]
SQLite3::ConstraintException: constraint failed: INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "fb_id", "fb_token", "first_name", "last_name", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "state", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
   (0.3ms)  rollback transaction
Completed 500 Internal Server Error in 441ms

ActiveRecord::StatementInvalid (SQLite3::ConstraintException: constraint failed: INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "fb_id", "fb_token", "first_name", "last_name", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "state", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)):
  sqlite3 (1.3.5) lib/sqlite3/statement.rb:108:in `step'
  sqlite3 (1.3.5) lib/sqlite3/statement.rb:108:in `block in each'
  sqlite3 (1.3.5) lib/sqlite3/statement.rb:107:in `loop'
  sqlite3 (1.3.5) lib/sqlite3/statement.rb:107:in `each'
  .
  .
  .

The above error has me really confused!

With the same form, when I add the password and password_confirmation fields, then things proceed smoothly – the user account is created and a confirmation email is sent to the user with the confirmation link.

I would appreciate any help regarding this – thanks! I am using Ruby 1.9.3-p125 and Rails 3.2.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:45:40+00:00Added an answer on June 3, 2026 at 9:45 am

    The issue isn’t due to Rails validation, it’s due to a violation of a database constraint.

    More than likely, if your users table migration was generated by Devise, then the schema includes this:

    "encrypted_password" varchar(128) DEFAULT '' NOT NULL
    

    The SQL that’s causing the ConstraintException includes this (elided for readability):

    SQL (14.0ms)  INSERT INTO "users" (..., "encrypted_password", ...) VALUES (..., ?, ...)  [..., ["encrypted_password", nil], ...]
    

    So, something is telling your database adapter to set encrypted_password = nil.

    You should be able to circumvent it either be running a migration that removes the NOT NULL constraint on the encrypted_password, or do as you’ve done, pass in an encrypted_password, but just make sure it’s empty in the first step, but present in the second step.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a two-step confirmation like heroku using Devise. My routes: devise_for
I'm trying to implement step two of the Recipe Box Facebook app tutorial. I
im trying to set the height of two divs on my page, because my
okay, so I'm trying to set up a webpage with a div wrapping two
I'm trying to merge two arrays for the values of array1 that are set
I'm trying to create two functions: get & set, that both accept an arbitrary
I am trying to create a set of objects using NSMutableSet. The object is
I'm trying to implement a two-step registration form for my site wherein I used
I'm trying to set up a view that displays two different models. For example,
I'm trying to set seletected value to a pre-loaded combobox using silverlight with MVVM.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.