SQLite3::BusyException: database is locked error

Hi guys,

I have a simply ruby script which creates database and creates one table
however when i try to run i get

SQLite3::BusyException: database is locked

error all the time. Database is being created but script cannot write to
it and somehow return that error. I tried to delete database, set
permission to 777 everywhere i could, make myself an owner. Nothing has
helped.

There is one interesting thing. That error is being thrown only in my
Apache root dir /usr/sites/(not sure how that can affect it) nowhere
else. If i try to run it in /usr/ or somewhere else it works just fine.
Crazy!!!

Any idea/advice???

db = SQLite3::Database.new( “test.db” )
puts “!!! \tDatabase has been created.\t!!!”
db.execute(‘CREATE TABLE meta ( test1 varchar(32), test2 varchar(32)
);’)
puts “!!! \tQuery has been executed.\t!!!”
db.close