Jeff Hoffman
2006-Jan-07 02:20 UTC
[Rails] Configuration problem on older app upgraded to 1.0
Hello, everyone. I have an application that began on a much earlier version of rails, and has been upgraded to 1.0. Somewhere along the line, tests got broken. The first thing I noticed, upon looking into the cause, is that my test database was not being cloned correctly from development. So, I tried to run the tasks by hand: $ rake clone_schema_to_test (in /Users/jkh/Development/assetstream) rake aborted! database configuration does not specify adapter $ rake clone_structure_to_test (in /Users/jkh/Development/assetstream) 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.[] Strangely, db_schema_export and db_schema_import work just fine. And my application runs fine. I am using MySQL, and it is configured correctly in database.yml. To make sure it wasn''t a syntax error, I copied database.yml to a fresh rails project and it works fine. There is something else in my project that is quirked, and causing the errors above. Any ideas? Jeff Hoffman
Alex Young
2006-Jan-07 09:37 UTC
[Rails] Configuration problem on older app upgraded to 1.0
Jeff Hoffman wrote:> Hello, everyone. > > I have an application that began on a much earlier version of rails, and has been upgraded to 1.0. Somewhere along the line, tests got broken. The first thing I noticed, upon looking into the cause, is that my test database was not being cloned correctly from development. So, I tried to run the tasks by hand: > > $ rake clone_schema_to_test > (in /Users/jkh/Development/assetstream) > rake aborted! > database configuration does not specify adapter > > $ rake clone_structure_to_test > (in /Users/jkh/Development/assetstream) > 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.[] > > Strangely, db_schema_export and db_schema_import work just fine. And my application runs fine. I am using MySQL, and it is configured correctly in database.yml. To make sure it wasn''t a syntax error, I copied database.yml to a fresh rails project and it works fine. There is something else in my project that is quirked, and causing the errors above. > > Any ideas?You may already have checked this, but if your tests are from an earlier version of Rails, they''re probably not using the current fixture syntax. It was one of the (very) few things that was broken in the 0.14 line. Check http://ar.rubyonrails.com/classes/Fixtures.html to make sure your ducks are in line :-) -- Alex