You see an error like this in your logs: ActiveRecord::StatementInvalid (SQLite3::SQLException: SQL logic error or missing database: INSERT INTO…). The statement it prints out is working fine when you run it directly.
First, one thing you can tell from this error is you are running the application using a different user id than you are testing with. Are you completely sure you want to run sqlite3 on some kind of production system? :)
If you really are sure, then address the problem. The other identity can’t read/write the database file AND folder.
Here’s your quick fix:
chmod 777 db
chmod 666 db/*.sqlite3
Now sit back and enjoy the sqlite goodness. Rest your weary feet in the cooling water :)