Hi, I have a MySQL database that I use with my Rails application. I attempted to use "rake db:test:prepare" to create a test database. (Very cool, feature, by the way.) I then get the error rake aborted! You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] After some search I learned that the schema dump cannot handle e.g. enum columns. There is an old ticket #2379 about it but it seems not to have been implemented in 2.0. ( I am using a Imac and textmate) I also found another solution (http://snippets.dzone.com/posts/show/2031) using a rake file that I called test_prepare.rake and put in lib/tasks/test_prepare.rake, but when I used the rake command I got the message Don''t know how to build task ''test_prepare'' The question is now how to create a test database?? When I tried just to use the development database it complained about that there was no test database configured. I tried several other rake commands but they all complained about the nil object or missing configuration ? How to go on with the testing ???? Thanks in advance. /Hans -- 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 -~----------~----~----~----~------~----~------~--~---
> The question is now how to create a test database??Can you create an empty database by hand, in MySQL, then migrate-in your schema with rake RAILS_ENV=test db:migrate ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:>> The question is now how to create a test database?? > > Can you create an empty database by hand, in MySQL, then migrate-in your > schema with > > rake RAILS_ENV=test db:migrate > > ?Thanks, it seems that your advice solved the problem. I had to do some other corrections as I had a blank before the database name in my configuration file and I had not init a constant in a plugin I not yet use. But then rake RAILS_ENV=test db:migrate created a test data base and I can now start the testings Thanks again -- 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 -~----------~----~----~----~------~----~------~--~---