From: Peter Vandenabeele Date: 2011-01-26T21:03:33+09:00 Subject: Re: Rails: Problem with test-environment and mysql2 database vivec manavortex wrote in post #977603: ... > I chased the bug deep down to databases.rake:429, and there it says: > task :purge => :environment do > abcs = ActiveRecord::Base.configurations > case abcs["test"]["adapter"] > when /mysql/ > > and the problem seems to be with the case-statement, there something > is a nil value (and most likely it is the "adapter" value in "test"?). > The adapter value is set in my database.yml, and everything is great > as long as I stay to the development environment - but I need to > get those tests working. Could it be that in the "test" section of database.yml you have a TAB (instead of 2 spaces)? Maybe that is not the yaml you expect. Maybe try: $ cd config $ irb > require 'yaml' => true > File.open('database.yml') do |f| > YAML::load(f.read) > end => {"development"=>{"adapter"=>"sqlite3", "database"=>"db/development.sqlite3", "pool"=>5, "timeout"=>5000}, "test"=>{"adapter"=>"sqlite3", "database"=>"db/test.sqlite3", "pool"=>5, "timeout"=>5000}, "production"=>{"adapter"=>"sqlite3", "database"=>"db/production.sqlite3", "pool"=>5, "timeout"=>5000}} and see if this is the correct result you expected. -- Posted via http://www.ruby-forum.com/.