Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails and Devise - Creating an initial user - missing encrypted password

I'm a little confused with how Devise is supposed to work with your initial admin user.

I can put a line like this in my seed file

User.create! :name => 'admin', :email => '[email protected]', :password => 'p@ssw0rd!', :password_confirmation => 'p@ssw0rd!'

But when I check my sqlite database I notice it generates no encrypted_password. What am I doing wrong? Do I need to call another method? Not sure what Devise handles here automatically for you.

UPDATE:

# Gemfile
gem 'rails', '3.0.10'
gem 'jquery-rails', '>= 1.0.12'
gem 'rmagick'
gem 'carrierwave'
gem 'cloudfiles'
gem 'devise'
gem 'fog'
gem 'acts-as-taggable-on', '~>2.1.0'
gem 'rails3-jquery-autocomplete'
gem 'sqlite3'

UPDATE 2
My devise settings of my User class

devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable
like image 909
BuddyJoe Avatar asked Nov 14 '22 18:11

BuddyJoe


1 Answers

Please

  • post the your logfile section for this issue
  • post your config/initializers/devise.rb (settings only, without comments)

Hopefully this helps to get it!

And, ehm, did you run the generator (rails generate devise:install)?

like image 120
erotte Avatar answered Dec 17 '22 16:12

erotte