开发者

sqlite3 db is locked

开发者 https://www.devze.com 2023-01-23 01:45 出处:网络
I am on Ubuntu10. Create new db file with touch development.db Want my migrations rake db:migrate but get locked error

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

精彩评论

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