# Encryption error

**URL:** <https://www.ruby-forum.com/t/encryption-error/162943>\
**Category:** Rails\
**Created:** [March 16, 2009, 1:37am UTC](https://www.ruby-forum.com/t/encryption-error/162943 "2009-03-16T01:37:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [March 16, 2009, 1:37am UTC](https://www.ruby-forum.com/t/encryption-error/162943/1 "2009-03-16T01:37:16Z")

</div>

I’m using authlogic. On my local machine everything runs fine, but on  
my production server it’s giving me an error, telling me that  
crypted\_password can’t be null when I try and create the admin user. I  
look at the error and notice that everything that’s supposed to be  
encrypted or use a generated token is NULL.

Mysql::Error: Column ‘crypted\_password’ cannot be null: INSERT INTO  
`users` (`created_at`, `crypted_password`, `role_id`,  
`current_login_ip`, `password_salt`, `persistence_token`,  
`last_login_ip`, `login`, `email`) VALUES(‘2009-03-16 00:28:44’, NULL,  
1, ‘’, NULL, NULL, ‘’, ‘admin’, ‘removed\_email\_address@domain.invalid’)

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [March 16, 2009, 3:02am UTC](https://www.ruby-forum.com/t/encryption-error/162943/2 "2009-03-16T03:02:01Z")

</div>

Error fixed. I was using restful auth before and switched over to  
authlogic, but forgot to remove some code that restful auth put in my  
User model.
