I have almost no Ruby knowlegde, but I chased this down to being a problem of the username validation on login. Our OpenLDAP system puts spaces in front of the email addresses during migration from another LDAP system, and those were used during LDAP login as username. You do what's best, maybe even completely not merge, but this works for me and I'm a bit time crunched.