When starting out a new rails project on Windows XP, I ran into a strange problem. I usually do all my development on Mac OSX, but this week I had a need to set up a new project on a XP box. After creating my rails project and a few models. I ran rake db:migrate to set up my development database. All seemed to be going well until I tried to run autotest. Prior to running my test suite, I ran the rake task to set up my test data base with the following result.
> rake db:test:prepare
rake aborted!
Permission denied - db/test.sqlite3
(See full trace by running task with –trace)
The full trace was not much help either. I’m using SQLite in this case, so I thought there may be a problem with the db/test.sqlite3 file in my project. I checked the permissions and everything looked fine. I was even able to connect to the test.sqlite3 data base using the sqlite3 command line and add tables, insert records, etc. Finally I tried to delete the test.sqlite3 file thinking I would just re-create it. Then I get the message from XP telling me that the file can not be deleted because it is being used by another process. Ah ha! Apparently, Aptana Studio had a lock on the file which was causing rake to puke. I closed Aptana Studio and the rake task ran as expected. I did look to make sure that the file was not open in studio first and it was not. Looks like Aptana Studio gets another demerit on the chalkboard today.
{ 3 comments }