Rails : Rake Test:functionals cannot access DB (Sqlite3 on winXP) Rails : Rake Test:functionals cannot access DB (Sqlite3 on winXP) sqlite sqlite

Rails : Rake Test:functionals cannot access DB (Sqlite3 on winXP)


I just had this issue. For me, it was caused by me having my rails console opened in a test environment. Closed my session and it no longer threw the error.


Very, very similar behavior on my part: Windows XP, SQLite3, Rails 2.3.4, Rake 0.8.7, Ruby 1.8.6

rake test

works (but I don't believe it's actually running the unit test)

rake test:units

and

rake test:functionals

both fail with a "Permission denied - db/test.sqlite3"With --trace enabled the specific error occurs at ../rails-2.3.4/lib/task/databases.rake:370 at a line that reads "File.delete(dbfile) if File.exist?(dbfile)

So... long story short... I commented it out.

This is NOT a fix, but it was enough of a hack to get the tests to work for me.


If you're running under Cygwin, try running this on your database files:

chmod 777 <your-files>

Cygwin can become confused about what permissions should be applied.

Yes I know these permissions are ridiculous, but so is Cygwin sometimes...