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

  • Home
  • SEARCH
  • 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 7885041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:57:33+00:00 2026-06-03T04:57:33+00:00

I was trying to integrate twitter authentication into my Ruby on Rails application (from

  • 0

I was trying to integrate twitter authentication into my Ruby on Rails application (from the Ruby on Rails Tutorial).

As a result I dropped a table (user table ) and had to recreate it. I want to now populate the database and I have this code for populating the table

namespace :db do
  desc "Fill database with sample data"
  task populate: :environment do
    User.create!(name: "Example User",
                 email: "example@railstutorial.org",
                 password: "foobar",
                 password_confirmation: "foobar")
    99.times do |n|
      name  = Faker::Name.name
      email = "example-#{n+1}@railstutorial.org"
      password  = "password"
      User.create!(name: name,
                   email: email,
                   password: password,
                   password_confirmation: password)
    end
  end
end

The following commands work:

$bundle exec rake:db migrate
$bundle exec rake:db reset

However the $bundle exec rake:db populate does NOT work.

There are the errors I am getting:

    $ bundle exec rake db:populate --trace
    ** Invoke db:populate (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Execute db:populate
    rake aborted!
    wrong number of arguments (0 for 1)
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/devise-2.0.4/lib/devise/models/database_auth
    enticatable.rb:105:in `password_digest'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/errors.rb
    :254:in `block in add_on_blank'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/errors.rb
    :253:in `each'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/errors.rb
    :253:in `add_on_blank'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/validatio
    ns/presence.rb:9:in `validate'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:310:in `_callback_before_39'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:484:in `_run__584816360__validate__204154762__callbacks'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:405:in `__run_callback'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:385:in `_run_validate_callbacks'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:81:in `run_callbacks'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/validatio
    ns.rb:212:in `run_validations!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/validatio
    ns/callbacks.rb:53:in `block in run_validations!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:425:in `_run__584816360__validation__204154762__callbacks'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:405:in `__run_callback'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:385:in `_run_validation_callbacks'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/callb
    acks.rb:81:in `run_callbacks'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/validatio
    ns/callbacks.rb:53:in `run_validations!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/validatio
    ns.rb:179:in `valid?'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/validat
    ions.rb:69:in `valid?'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/validat
    ions.rb:77:in `perform_validations'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/validat
    ions.rb:56:in `save!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/attribu
    te_methods/dirty.rb:33:in `save!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/transac
    tions.rb:246:in `block in save!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/transac
    tions.rb:295:in `block in with_transaction_returning_status'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/connect
    ion_adapters/abstract/database_statements.rb:190:in `transaction'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/transac
    tions.rb:208:in `transaction'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/transac
    tions.rb:293:in `with_transaction_returning_status'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/transac
    tions.rb:246:in `save!'
    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/validat
    ions.rb:41:in `create!'
    c:/tuffy/shopgodt/lib/tasks/sample_data.rake:4:in `block (2 levels) in <top (req
    uired)>'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `call'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
    c:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
    c:/Ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_lev
    el'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `each'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handlin
    g'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handlin
    g'
    c:/Ruby193/lib/ruby/1.9.1/rake/application.rb:63:in `run'
    c:/Ruby193/bin/rake:32:in `<main>'
    Tasks: TOP => db:populate

Any help on this matter is appreciated. Thanks again!

============================================================

Update 05/02/2012: Since I had wanted to add third party logins (facebook,twitter) I added the Devise gem but I am not sure which command I ran that resulted in these these two lines that were added to my app/models/User.rb file

:token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
 devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable

Once I commented them out everything ran fine. I would like to understand though what these two lines are doing?

  • 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-03T04:57:34+00:00Added an answer on June 3, 2026 at 4:57 am

    There are two hints to what’s wrong

    c:/tuffy/shopgodt/lib/tasks/sample_data.rake:4:in 'block (2 levels) in <top (required)>'

    tells you it’s on line 4 which is the call to create!

    Coupled with

    c:/Ruby193/lib/ruby/gems/1.9.1/gems/activemodel-3.2.0/lib/active_model/validations/presence.rb:9:in 'validate'

    says that a validation is failing. Is there a validation expecting the presence of some field you’re not providing? Check your User model for validates :some_field_name, :presence => true

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

Sidebar

Related Questions

I am trying to integrate Twitter into my application. My basic requirement is to
I am trying to integrate facebook,twitter,linkedin chat in to one java application. I was
I am trying to integrate a Hibernate application into a proprietary framework. My problem
I'm trying to integrate Twitter in my android application. I've checked Android10 and abhinavblog's
Ok so I am trying to integrate twitter into my iPhone app. I have
I am trying to integrate twitter into an iOS app using Ben Gottlieb's Twitter-OAuth-iPhone
I'm trying to integrate searchable help into my Java (Swing) application. I'm using docbook
I am trying to integrate AdMob into my Android Application, and can get it
I am trying to integrate twitter framework into my app to give the users
I am trying to integrate twitter into devise using this guide . I basically

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.