开发者

sqlite3 db is locked

I am on Ubuntu10. Create new db file with

touch development.db

Want my migrations

rake db:migrate

but get locked error

SQLite3::BusyException: database is locked

How it can be locked?!


update it can be locked by samba. it's shared开发者_开发技巧 folder


I have run into this problem myself. I have found that the only way to avoid the lock being placed on a file like this is to add the nobrl option to your mount. The entry in your /etc/fstab might look something like this:

//<SERVERNAME>/<REMOTEPATH> /<LOCALMOUNTPOINT>/<LOCALPATH> cifs credentials=/home/<LOCALUSERNAME>/.smbcredentials,iocharset=utf8,uid=1000,gid=1000,file_mode=0775,dir_mode=0775,nobrl 0 0

This is loosely following the ubuntu wiki page found at: https://wiki.ubuntu.com/MountWindowsSharesPermanently


You should try rake db:create instead of touch. This always works for me. Maybe there's a problem with the migrations itself?


i think it was locked by samba.

i put development.db in other non-shared folder and everything works as expected

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜