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! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org http://www.marnen.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Ororie wrote:> >> 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 >I believe those are supposed to be commas not semi-colons after the column names. Norm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---