Hi,I followed the process of creating depot in the book ''Ruby on Rails'' all works fine until I came to the ''Checkout'' chapter. After I created the two models order and line_item and got the two migration file altered according to the book, I failed by running rake db:migrate errors are shown as below C:\Java\workspace\depot>rake db:migrate (in C:/Java/workspace/depot) == CreateLineItems: migrating ================================================-- create_table(:line_items) rake aborted! Mysql::Error: #42S01Table ''line_items'' already exists: CREATE TABLE line_items ( `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `product_id` int(11) NOT N ULL, `order_id` int(11) NOT NULL, `quantity` int(11) NOT NULL, `total_price` int (11) NOT NULL) ENGINE=InnoDB By running --trace I can also see C:\Java\workspace\depot>rake db:migrate -trace C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `re quire__'': no such file to load -- ace (LoadError) from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require .rb:21:in `require'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1749:in `do_option'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1787:in `handle_options'' from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:460:in `each'' from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:457:in `each'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1787:in `handle_options'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1897:in `run'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 from C:/InstantRails/ruby/bin/rake.bat:25 I followed the book strictly, so couldn;t figured out what has happened. anybody has a similar/same problem using this book? greatly appreciated for your help! -- 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 -~----------~----~----~----~------~----~------~--~---
Is that table already in the system? If so, you may have to use the "force" option with create_table. Did you happen to run rake migrate before you added the columns? Jacquie Fan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: Hi,I followed the process of creating depot in the book ''Ruby on Rails'' all works fine until I came to the ''Checkout'' chapter. After I created the two models order and line_item and got the two migration file altered according to the book, I failed by running rake db:migrate errors are shown as below C:\Java\workspace\depot>rake db:migrate (in C:/Java/workspace/depot) == CreateLineItems: migrating ================================================-- create_table(:line_items) rake aborted! Mysql::Error: #42S01Table ''line_items'' already exists: CREATE TABLE line_items ( `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `product_id` int(11) NOT N ULL, `order_id` int(11) NOT NULL, `quantity` int(11) NOT NULL, `total_price` int (11) NOT NULL) ENGINE=InnoDB By running --trace I can also see C:\Java\workspace\depot>rake db:migrate -trace C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `re quire__'': no such file to load -- ace (LoadError) from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require .rb:21:in `require'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1749:in `do_option'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1787:in `handle_options'' from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:460:in `each'' from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:457:in `each'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1787:in `handle_options'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1897:in `run'' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 from C:/InstantRails/ruby/bin/rake.bat:25 I followed the book strictly, so couldn;t figured out what has happened. anybody has a similar/same problem using this book? greatly appreciated for your help! -- Posted via http://www.ruby-forum.com/. --------------------------------- Get your email and more, right on the new Yahoo.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 -~----------~----~----~----~------~----~------~--~---
Thanks for the help! The migration works now by adding :force=>true Will Gant wrote:> Is that table already in the system? If so, you may have to use the > "force" option with create_table. Did you happen to run rake migrate > before you added the columns? > > Jacquie Fan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > Hi,I followed the process of creating depot in the book ''Ruby on Rails'' > all works fine until I came to the ''Checkout'' chapter. > > After I created the two models order and line_item and got the two > migration file altered according to the book, I failed by running rake > db:migrate-- 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 -~----------~----~----~----~------~----~------~--~---
Right, but bear in mind the force=>true overwrites your data. Please tell me you didn''t learn it the hard way like I did... Jacquie Fan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: Thanks for the help! The migration works now by adding :force=>true Will Gant wrote:> Is that table already in the system? If so, you may have to use the > "force" option with create_table. Did you happen to run rake migrate > before you added the columns? > > Jacquie Fan wrote: > Hi,I followed the process of creating depot in the book ''Ruby on Rails'' > all works fine until I came to the ''Checkout'' chapter. > > After I created the two models order and line_item and got the two > migration file altered according to the book, I failed by running rake > db:migrate-- Posted via http://www.ruby-forum.com/. --------------------------------- Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ugh. The way I said that sounds kind of bad. I just hope I didn''t cause you to have to re-enter a whole mess of data (like I''ve done a couple of times).. Will Gant <williamwgant-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: Right, but bear in mind the force=>true overwrites your data. Please tell me you didn''t learn it the hard way like I did... Jacquie Fan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: Thanks for the help! The migration works now by adding :force=>true Will Gant wrote:> Is that table already in the system? If so, you may have to use the > "force" option with create_table. Did you happen to run rake migrate > before you added the columns? > > Jacquie Fan wrote: > Hi,I followed the process of creating depot in the book ''Ruby on Rails'' > all works fine until I came to the ''Checkout'' chapter. > > After I created the two models order and line_item and got the two > migration file altered according to the book, I failed by running rake > db:migrate-- Posted via http://www.ruby-forum.com/. --------------------------------- Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. --------------------------------- All-new Yahoo! Mail - Fire up a more powerful email and get things done faster. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks for reminding me. No I didn''t enter anything yet.=) Will Gant wrote:> Ugh. The way I said that sounds kind of bad. I just hope I didn''t cause > you to have to re-enter a whole mess of data (like I''ve done a couple of > times).. > > Will Gant <williamwgant-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: Right, but bear in mind the > force=>true overwrites your data. Please tell me you didn''t learn it the > hard way like I did... > > > --------------------------------- > All-new Yahoo! Mail - Fire up a more powerful email and get things done > faster.-- 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 -~----------~----~----~----~------~----~------~--~---
I''m having a similar problem here... I''m not able to get rid of force => true flag. On every migration or "rake db:fixtures:load" I run, the db/schema.db file is updated with force=>true. What am I missing ? Is there any config/environment.rb setting I''ve to add/modify to get rid of force=>true ? Thanks in advance. On 9/27/06, Will Gant <williamwgant-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Is that table already in the system? If so, you may have to use the "force" > option with create_table. Did you happen to run rake migrate before you > added the columns? > > > Jacquie Fan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > Hi,I followed the process of creating depot in the book ''Ruby on Rails'' > all works fine until I came to the ''Checkout'' chapter. > > After I created the two models order and line_item and got the two > migration file altered according to the book, I failed by running rake > db:migrate > > errors are shown as below > > C:\Java\workspace\depot>rake db:migrate > (in C:/Java/workspace/depot) > == CreateLineItems: migrating > ================================================> -- create_table(:line_items) > rake aborted! > Mysql::Error: #42S01Table ''line_items'' already exists: CREATE TABLE > line_items ( > `id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `product_id` > int(11) NOT N > ULL, `order_id` int(11) NOT NULL, `quantity` int(11) NOT NULL, > `total_price` int > (11) NOT NULL) ENGINE=InnoDB > > By running --trace I can also see > > C:\Java\workspace\depot>rake db:migrate -trace > C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in > `re > quire__'': no such file to load -- ace (LoadError) > from > C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require > .rb:21:in `require'' > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: > 1749:in `do_option'' > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: > 1787:in `handle_options'' > from > C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:460:in > `each'' > from > C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:457:in > `each'' > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: > 1787:in `handle_options'' > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: > 1897:in `run'' > from > C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > from C:/InstantRails/ruby/bin/rake.bat:25 > > I followed the book strictly, so couldn;t figured out what has happened. > > anybody has a similar/same problem using this book? greatly appreciated > for your help! > > > -- > Posted via http://www.ruby-forum.com/. > > ________________________________ > Get your email and more, right on the new Yahoo.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 -~----------~----~----~----~------~----~------~--~---