I am a VERY newbie, so please forgive me. I created a project from a tutorial availible online, and when I ran the rake test, it came up with the following error: 218 % rake test_units (in /rubydev/devblog) rake aborted! Mysql::Error: You have an error in your SQL syntax near ''ENGINE=InnoDB'' at lin e 1: CREATE TABLE comments (`id` int(11) DEFAULT NULL auto_increment PRIMARY K EY, `body` text DEFAULT '''' NOT NULL, `post_id` int(11) DEFAULT 0 NOT NULL) ENG INE=InnoDB (See full trace by running task with --trace) I ran it with ''--trace'' and of couse it errored out also. here is what it said: 219 % rake test_units --trace (in /rubydev/devblog) ** Invoke test_units (first_time) ** Invoke test:units (first_time) ** Invoke db:test:prepare (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:test:prepare ** Invoke db:test:clone (first_time) ** Invoke db:schema:dump (first_time) ** Invoke environment ** Execute db:schema:dump ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:clone ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load rake aborted! Mysql::Error: You have an error in your SQL syntax near ''ENGINE=InnoDB'' at line 1: CREATE TABLE comments (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `body` text DEFAULT '''' NOT NULL, `post_id` int(11) DEFAULT 0 NOT NULL) ENGINE=InnoDB /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:243:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:104:in `create_table'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:353:in `create_table'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:275:in `send'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:275:in `method_missing'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:259:in `say_with_time'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:259:in `say_with_time'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/migration.rb:273:in `method_missing'' ./db/schema.rb:7 /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/schema.rb:43:in `instance_eval'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/schema.rb:43:in `define'' ./db/schema.rb:5 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:31 /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:76 /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:153 /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:369:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `send'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:368:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:369:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `send'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:368:in `invoke_prerequisites'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/local/bin/rake:16:in `load'' /usr/local/bin/rake:16 I understand that the problem is that RNR is unable to create the tables needed in the test database, the question is how do I fix the problem so that it will run the test correctly? -- 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 -~----------~----~----~----~------~----~------~--~---
On Jul 5, 2007, at 5:57 PM, Jim Tittle wrote:> I am a VERY newbie, so please forgive me. > > I created a project from a tutorial availible online, and when I > ran the > rake test, it came up with the following error: > > 218 % rake test_units > (in /rubydev/devblog) > rake aborted! > Mysql::Error: You have an error in your SQL syntax near > ''ENGINE=InnoDB'' > at lin > e 1: CREATE TABLE comments (`id` int(11) DEFAULT NULL auto_increment > PRIMARY K > EY, `body` text DEFAULT '''' NOT NULL, `post_id` int(11) DEFAULT 0 NOT > NULL) ENG > INE=InnoDB > ... > I understand that the problem is that RNR is unable to create the > tables > needed in the test database, the question is how do I fix the > problem so > that it will run the test correctly?What version of MySQL are you using? Does it support the ENGINE=InnoDB syntax (I think the syntax prior to 5.x was TYPE=InnoDB)? -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn wrote:> On Jul 5, 2007, at 5:57 PM, Jim Tittle wrote: >> ''ENGINE=InnoDB'' >> problem so >> that it will run the test correctly? > > What version of MySQL are you using? Does it support the > ENGINE=InnoDB syntax (I think the syntax prior to 5.x was TYPE=InnoDB)? > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.orgYes it is an old version of MySQL - 3.23.54. Is there a way to make this distinction? -- 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 -~----------~----~----~----~------~----~------~--~---
On Jul 5, 2007, at 6:39 PM, Jim Tittle wrote:> > Rob Biedenharn wrote: >> On Jul 5, 2007, at 5:57 PM, Jim Tittle wrote: >>> ''ENGINE=InnoDB'' >>> problem so >>> that it will run the test correctly? >> >> What version of MySQL are you using? Does it support the >> ENGINE=InnoDB syntax (I think the syntax prior to 5.x was >> TYPE=InnoDB)? >> >> -Rob >> >> Rob Biedenharn http://agileconsultingllc.com >> Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org > > Yes it is an old version of MySQL - 3.23.54. Is there a way to make > this > distinction?Hey, I found an old migration in an old project: class CreateUsersTable < ActiveRecord::Migration def self.up create_table(:users, :options => ''TYPE=InnoDB'') do |t| # DEFAULT CHARSET=utf8 t.column :first_name, :string, :limit => 30, :null => false t.column :last_name, :string, :limit => 30, :null => false t.column :department, :string t.column :phone, :string, :limit => 24 end end def self.down drop_table(:users) end end This was when the default was MyIsam and might have also been with 4.x (like I said, it was old), but the server was running 3.23 so I think that''s how I landed on this syntax. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.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 -~----------~----~----~----~------~----~------~--~---