Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAnn Novakowski
3,004 PointsI keep receiving errors every time I try to run "rake db:migrate". How do I fix this??
annies-laptop:odot annharris$ bin/rake db:migrate
Running via Spring preloader in process 81698
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
[DEPRECATION] last_comment
is deprecated. Please use last_description
instead.
== 20160503211616 CreateTodoLists: migrating ==================================
-- create_table(:todo_lists)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
undefined method stringdescription' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007fe7f1abe498>
/Users/annharris/Desktop/treehouse/odot/db/migrate/20160503211616_create_todo_lists.rb:4:in
block in change'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:202:in create_table'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:665:in
block in method_missing'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in block in say_with_time'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in
say_with_time'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:654:in method_missing'
/Users/annharris/Desktop/treehouse/odot/db/migrate/20160503211616_create_todo_lists.rb:3:in
change'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:608:in exec_migration'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:592:in
block (2 levels) in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:591:in block in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in
with_connection'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:590:in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:768:in
migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:998:in block in execute_migration_in_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in
block in ddl_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in block in transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/transaction.rb:184:in
within_new_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/transactions.rb:220:in
transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in ddl_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:997:in
execute_migration_in_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:959:in block in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in
each'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:823:in
up'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:801:in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/tasks/database_tasks.rb:137:in
migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/railties/databases.rake:44:in block (2 levels) in <top (required)>'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in
load'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in block in load'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in
load_dependency'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in load'
-e:1:in
<main>'
NoMethodError: undefined method stringdescription' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007fe7f1abe498>
/Users/annharris/Desktop/treehouse/odot/db/migrate/20160503211616_create_todo_lists.rb:4:in
block in change'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:202:in create_table'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:665:in
block in method_missing'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in block in say_with_time'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in
say_with_time'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:654:in method_missing'
/Users/annharris/Desktop/treehouse/odot/db/migrate/20160503211616_create_todo_lists.rb:3:in
change'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:608:in exec_migration'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:592:in
block (2 levels) in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:591:in block in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in
with_connection'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:590:in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:768:in
migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:998:in block in execute_migration_in_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in
block in ddl_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in block in transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/transaction.rb:184:in
within_new_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/transactions.rb:220:in
transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in ddl_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:997:in
execute_migration_in_transaction'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:959:in block in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in
each'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:823:in
up'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:801:in migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/tasks/database_tasks.rb:137:in
migrate'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/railties/databases.rake:44:in block (2 levels) in <top (required)>'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in
load'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in block in load'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in
load_dependency'
/Users/annharris/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in load'
-e:1:in
<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Ann Novakowski
3,004 PointsSeth Kroger - How do I do that? I'm a beginner trying to follow along with the videos.
2 Answers
Daniel Cox
15,966 PointsHey @annhnova,
In the db/migrate folder ... there is a file called 20160503211616_create_todo_lists.rb.
Open that file and you have a error around line 4.
Linda Joy
5,415 PointsI have this problem as well -- how can you tell what the error is or how to fix it?
Daniel Cox
15,966 PointsAre you still having the problem?
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsCan you post the migration's script? I appears there's an error in it.