# Rake aborted (wrong number of arguments)

**URL:** <https://www.ruby-forum.com/t/rake-aborted-wrong-number-of-arguments/156077>\
**Category:** Rails\
**Created:** [December 20, 2008, 5:02am UTC](https://www.ruby-forum.com/t/rake-aborted-wrong-number-of-arguments/156077 "2008-12-20T05:02:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanoverton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@ryanoverton](https://www.ruby-forum.com/u/ryanoverton)\
**Post date:** [December 20, 2008, 5:02am UTC](https://www.ruby-forum.com/t/rake-aborted-wrong-number-of-arguments/156077/1 "2008-12-20T05:02:04Z")

</div>

I’m following a tutorial here to get some columns in my database. I  
generated a model called ‘product’ then I edited  
‘db/001\_create\_products.rb’ to have a few columns but when I try to  
migrate I get this error:

# bio4054059:depot rmorourk$ rake db:migrate (in /Users/rmorourk/Sites/depot) == CreateProducts: migrating

– create\_table(:products)  
rake aborted!  
wrong number of arguments (1 for 2)

(See full trace by running task with --trace)  
bio4054059:depot rmorourk$

I copied the code exactly for the 001\_create\_products.rb not really sure  
what it means by wrong number of arguments… any advise would be  
welcomed happily!

---

<div class="post-metadata">

**Author:** ![ryanoverton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@ryanoverton](https://www.ruby-forum.com/u/ryanoverton)\
**Post date:** [December 20, 2008, 6:22am UTC](https://www.ruby-forum.com/t/rake-aborted-wrong-number-of-arguments/156077/2 "2008-12-20T06:22:14Z")

</div>

What does 001\_create\_products.rb look like?

(BTW, if your migration filenames look like that, your tutorial may be  
for an older version of Rails. If you use script/generate migration,  
newer versions of Rails will use a timestamp, so that the filename  
might be something like 20081217040235\_create\_products.rb . That’s  
not a big deal in itself – either naming scheme will work – but it  
_does_ imply that you may be using a slightly outdated tutorial.)

## Best,

Marnen Laibow-Koser  
removed\_email\_address@domain.invalid  
[http://www.marnen.org](http://www.marnen.org)

---

<div class="post-metadata">

**Author:** ![ryanoverton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@ryanoverton](https://www.ruby-forum.com/u/ryanoverton)\
**Post date:** [December 20, 2008, 7:41pm UTC](https://www.ruby-forum.com/t/rake-aborted-wrong-number-of-arguments/156077/3 "2008-12-20T19:41:20Z")

</div>

> What does 001\_create\_products.rb look like?

It looks like this - is there something wrong with it?

class CreateProducts \< ActiveRecord::Migration  
def self.up  
create\_table :products do |t|  
t.column :title; :string  
t.column :description; :text  
t.column :image\_url; :string  
end  
end

def self.down  
drop\_table :products  
end  
end

---

<div class="post-metadata">

**Author:** ![ryanoverton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@ryanoverton](https://www.ruby-forum.com/u/ryanoverton)\
**Post date:** [December 20, 2008, 10:04pm UTC](https://www.ruby-forum.com/t/rake-aborted-wrong-number-of-arguments/156077/4 "2008-12-20T22:04:44Z")

</div>

Ryan O. wrote:

> ```
> t.column :description; :text
> t.column :image_url; :string
> end
> 
> ```
> 
> end
> 
> def self.down  
> drop\_table :products  
> end  
> end

I believe those are supposed to be commas not semi-colons after the  
column names.

Norm
