User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
When I run rake db:seed I am receiving an error, which I am assuming may have something to do with date objects being built as attributes on the models I am creating in the seeds.rb. If this is the reason, is there a way around it? Here is the error output:
rake aborted!
PG::InvalidTimeZoneDisplacementValue: ERROR: time zone displacement out of range:"-4712-01-01": INSERT INTO "courses"("code","created_at","description","end_on","image_content_type","image_file_name","image_file_size","image_updated_at","instructor_token","name","public","school","start_on","student_token","syllabus","ta_token","term","updated_at","year") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING "id"/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1174:in`get_last_result'
/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1174:in `exec_cache'
/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in `block in exec_query'/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:280:in`block in log'
/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in`exec_query'
/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
/Users/evankline/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'/Users/evankline/.rvm/gems/ruby
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that
you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice
sessions to improve your knowledge and scores.
manpreet
Best Answer
3 years ago
When I run rake db:seed I am receiving an error, which I am assuming may have something to do with date objects being built as attributes on the models I am creating in the seeds.rb. If this is the reason, is there a way around it? Here is the error output: