I typed code"ruby script/generate model as name:string description:text price:decimal seller_id:integer email:string img_url:string"in"rail_apps".but the cmd shows the error like what the title shows.You can know more refering to the Chap2 of the book"[深入浅出.Ruby.on.Rails].OReilly.Head.First.Rails.Jan.A.learner's.companion.to.Ruby.on.Rails.2009"I am looking forward your help.Thankyou~
1 Answer
In Rails 3, you need to use rails generate ... instead of ./script/generate ... (or ruby script/generate ...).
Likewise, script/console is now rails console (or rails c for short) and script/server is rails server (or rails s for short).
2 Comments
tjw1135
Thanks~The rails I use is the instant rails,but it seems that it can identify the codes like "script/generate.."and so on..
tjw1135
I met another problem just now.I typed "cd generate"and then "rake db:migrate"but the CMD shows that "rake aborted could not open database" can ya figure out why..I am really sorry to trouble you coz I am such a rookie..