plataformatec/devise — Issue #1428: Binary data inserted for `string` type on column `encrypted_password`
Author: PatrickMa
Created: 2011-11-08 04:32:26+00:00
State: open

So I'm trying to rewrite an application in Rails 3.1 from Rails 3.0 and I'm using the same db schema. I'm getting this error:

ruby-1.9.2-p290 :014 > Factory(:user)
(0.2ms) SELECT 1 FROM "users" WHERE "users"."email" = 'pma4@novafist.com' LIMIT 1
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'iwJZGc7AbcqKLnLjjU2A' LIMIT 1
Binary data inserted for `string` type on column `encrypted_password`
SQL (1.6ms) INSERT INTO "users" ("admin", "agree_to_tos", "birthday", "confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "facebook_url", "first_name", "hobby", "hometown", "interesting_facts", "job", "last_name", "last_sign_in_at", "last_sign_in_ip", "photo", "receive_newsletters", "remember_created_at", "reset_password_sent_at", "reset_password_token", "school", "sign_in_count", "updated_at", "username", "website", "why_i_snackwork") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["admin", false], ["agree_to_tos", false], ["birthday", nil], ["confirmation_sent_at", Tue, 08 Nov 2011 04:29:17 UTC +00:00], ["confirmation_token", "iwJZGc7AbcqKLnLjjU2A"], ["confirmed_at", nil], ["created_at", Tue, 08 Nov 2011 04:29:17 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "pma4@novafist.com"], ["encrypted_password", "$2a$10$8Kbc2YM.3OLZyndW4XLSuuSzgUJWGDiiTHSI0dX..PFQR0HgAK5BK"], ["facebook_url", nil], ["first_name", nil], ["hobby", nil], ["hometown", nil], ["interesting_facts", nil], ["job", nil], ["last_name", nil], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["photo", nil], ["receive_newsletters", true], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["school", nil], ["sign_in_count", 0], ["updated_at", Tue, 08 Nov 2011 04:29:17 UTC +00:00], ["username", "pma4"], ["website", nil], ["why_i_snackwork", nil]]
RuntimeError: Could not find a valid mapping for #
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/mapping.rb:41:in `find_scope!'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/mailers/helpers.rb:25:in `initialize_from_record'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/mailers/helpers.rb:20:in `devise_mail'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/app/mailers/devise/mailer.rb:5:in `confirmation_instructions'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/abstract_controller/base.rb:167:in `process_action'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/abstract_controller/base.rb:121:in `process'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/abstract_controller/rendering.rb:45:in `process'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.1.1/lib/action_mailer/old_api.rb:65:in `process'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.1.1/lib/action_mailer/base.rb:474:in `process'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.1.1/lib/action_mailer/base.rb:469:in `initialize'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.1.1/lib/action_mailer/base.rb:456:in `new'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.1.1/lib/action_mailer/base.rb:456:in `method_missing'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/models/confirmable.rb:50:in `send_confirmation_instructions'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:403:in `_run_create_callbacks'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/callbacks.rb:268:in `create'
... 9 levels...
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/transactions.rb:208:in `transaction'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/transactions.rb:246:in `save!'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/factory_girl-2.2.0/lib/factory_girl/proxy/create.rb:9:in `result'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/factory_girl-2.2.0/lib/factory_girl/factory.rb:75:in `run'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/factory_girl-2.2.0/lib/factory_girl/syntax/methods.rb:60:in `create'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/factory_girl-2.2.0/lib/factory_girl/syntax/vintage.rb:50:in `default_strategy'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/factory_girl-2.2.0/lib/factory_girl/syntax/vintage.rb:143:in `Factory'
from (irb):14
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
from /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:40:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'ruby-1.9.2-p290 :015 >