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 trial

Ruby ActiveRecord Basics Migrations and Relationships Has and Belongs to Many

Hi, I have been following along and everything has been working up until 3:25 of the video running rake db:migrate

I continue to get this error in my terminal:

biller [] :> rake db:migrate == 20150526230917 AccountEntries: migrating =================================== -- add_column(:time_entries, :account_id_integer) rake aborted! StandardError: An error has occurred, all later migrations canceled:

wrong number of arguments (2 for 3..4)/Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:390:in add_column' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:inblock in method_missing' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in block in say_with_time' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:insay_with_time' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:652:in method_missing' /Users/Missy/Desktop/Tt_projects/biller/db/migrate/20150526230917_account_entries.rb:3:inchange' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:606:in exec_migration' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:inblock (2 levels) in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in block in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:inwith_connection' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:inmigrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in block in execute_migration_in_transaction' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1043:inddl_transaction' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in execute_migration_in_transaction' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:inblock in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in each' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:inmigrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in up' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:inmigrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:inblock (2 levels) in <top (required)>' ArgumentError: wrong number of arguments (2 for 3..4) /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:390:in add_column' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:inblock in method_missing' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in block in say_with_time' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:insay_with_time' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:652:in method_missing' /Users/Missy/Desktop/Tt_projects/biller/db/migrate/20150526230917_account_entries.rb:3:inchange' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:606:in exec_migration' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:inblock (2 levels) in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in block in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:inwith_connection' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:inmigrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in block in execute_migration_in_transaction' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1043:inddl_transaction' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in execute_migration_in_transaction' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:inblock in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in each' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:inmigrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in up' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:inmigrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in migrate' /Users/Missy/.rvm/gems/ruby-2.1.0/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:inblock (2 levels) in <top (required)>' Tasks: TOP => db:migrate (See full trace by running task with --trace)

If someone could help I would really appreciate it!!!

Thanks!

1 Answer

Seth Reece
Seth Reece
32,867 Points

Your specific error is "wrong number of arguments (2 for 3..4)". Without looking at your code this would be hard to diagnose.