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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:22:34+00:00 2026-05-27T21:22:34+00:00

When I run rake db:seed ,something are broken! I get the following error: ray@ray-virtual-machine:~/ticketee$

  • 0

When I run rake db:seed ,something are broken!

I get the following error:

ray@ray-virtual-machine:~/ticketee$ rake db:seed rake aborted!
SQLite3::ConstraintException: constraint failed: INSERT INTO “users”
(“admin”, “confirmation_sent_at”, “confirmation_token”,
“confirmed_at”, “created_at”, “current_sign_in_at”,
“current_sign_in_ip”, “email”, “encrypted_password”,
“last_sign_in_at”, “last_sign_in_ip”, “remember_created_at”,
“reset_password_sent_at”, “reset_password_token”, “sign_in_count”,
“updated_at”) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Tasks: TOP => db:seed (See full trace by running task with –trace)

Here my seeds.rb:

admin_user = User.create(:email => “admin@ticketee.com”,
:password => “password”)
admin_user.admin = true

admin_user.confirm!

Project.create(:name => “Ticketee Beta”)

Here my gem-list:

> source 'http://rubygems.org'
> 
> gem 'rails', '3.1.0'
> 
> # Bundle edge Rails instead:
> # gem 'rails',     :git => 'git://github.com/rails/rails.git'
> 
> gem 'sqlite3'
> 
> 
> # Gems used only for assets and not required
> # in production environments by default. group :assets do   gem 'sass-rails', "  ~> 3.1.0"   gem 'coffee-rails', "~> 3.1.0"   gem
> 'dynamic_form'   gem 'uglifier' end
> 
> gem 'jquery-rails'
> 
> # Use unicorn as the web server
> # gem 'unicorn'
> 
> # Deploy with Capistrano
> # gem 'capistrano'
> 
> # To use debugger
> # gem 'ruby-debug19', :require => 'ruby-debug'
> 
> group :test, :development do   # Pretty printed test output   gem
> 'rspec-rails', '~>2.7' end
> 
> group :test do   gem 'cucumber-rails'   gem 'capybara'   gem
> 'database_cleaner'   gem 'email_spec'   gem 'factory_girl' end
> 
> gem 'devise', '~> 1.4.3' gem 'cancan'

when I run ” rake db:seed –trace “

ray@ray-virtual-machine:~/ticketee$ rake db:seed --trace
** Invoke db:seed (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:seed
rake aborted!
SQLite3::ConstraintException: constraint failed: INSERT INTO "users" ("admin", "confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/statement.rb:108:in `step'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/statement.rb:108:in `block in each'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/statement.rb:107:in `loop'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/statement.rb:107:in `each'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb:192:in `to_a'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb:192:in `block in exec_query'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb:171:in `exec_query'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/relation.rb:70:in `insert'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/persistence.rb:313:in `create'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/timestamp.rb:51:in `create'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/callbacks.rb:268:in `block in create'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:401:in `_run_create_callbacks'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/callbacks.rb:268:in `create'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/persistence.rb:294:in `create_or_update'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/callbacks.rb:264:in `block in create_or_update'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:399:in `_run_save_callbacks'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/callbacks.rb:264:in `create_or_update'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/persistence.rb:37:in `save'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/validations.rb:50:in `save'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:241:in `block (2 levels) in save'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:208:in `transaction'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:241:in `block in save'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/transactions.rb:240:in `save'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/models/confirmable.rb:38:in `block in confirm!'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/models/confirmable.rb:111:in `unless_confirmed'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.9/lib/devise/models/confirmable.rb:35:in `confirm!'
/home/ray/ticketee/db/seeds.rb:12:in `<top (required)>'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `block in load'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/engine.rb:487:in `load_seed'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:299:in `block (2 levels) in <top (required)>'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/ray/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/ray/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/ray/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/ray/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:seed

Can you tell me what happen in my code?I am a new.

Thanks a lot for your time.

  • 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-05-27T21:22:34+00:00Added an answer on May 27, 2026 at 9:22 pm

    My guess is that you are not providing all required fields when you call:

    admin_user = User.create(:email => "admin@ticketee.com", :password => "password") 
    

    What does your migration file for the table Users look like?
    What are the validations you have put into your Model Users?

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

Sidebar

Related Questions

When I run rake db:seed in my Rails 3 application I get the error:
while attempting to run rake, I run into the following error: heroku rake db:migrate
When I run rake run:android, I get the error (I'm using Ubuntu): Your java
during run rake for rails application i got following error Function 'zmq_getsockopt' not found
When I run rake db:create I receive this error rake aborted! no such file
When I run rake gems:build with hpricot 0.6.164 on my FreeBSD server I get:
I have managed to get a cron job to run a rake task by
I'm trying to get a compile command (rake cucumber) to run with a specific
I'm using gvim and rails.vim and getting the following error when attempting to run
After I run rake ts:index and try to start the sphinx server I get

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.