SQLite3::SQLException: SQL logic error or missing database
SQLite3 :: SQLException:SQL逻辑错误或缺少数据库
error when do insert, update and delete operation to tables from browser( that means the create, update and destroy action is failed but the show action is fine ), the same operation in console is OK. I googled this problem and found most of the solutions is to remove duplication in the fixtures, so I removed all the test data from the fixture and restart the server, and it failed again:(
Any advise is appreciated.
从浏览器执行对表的插入,更新和删除操作时出错(这意味着创建,更新和销毁操作失败,但show动作很好),控制台中的相同操作是正常的。我搜索了这个问题并发现大多数解决方案是删除灯具中的重复,所以我从灯具中删除了所有测试数据并重新启动服务器,它再次失败:(任何建议表示赞赏。
2 个解决方案
#1
It turned out that I forget use "sudo script/server"
to get write permission to the database :)
原来,我忘了使用“sudo script / server”来获取数据库的写权限:)
#2
I don't mean to resurrect the dead, but I just encountered this problem, and the popular answers I found did not apply.
我并不是要复活死者,但我刚刚遇到这个问题,我发现的流行答案并不适用。
My problem turned out to be the SQLite Manager add-on for Firefox. I used the SysInternals "handle" program to determine that a) Firefox/SQLiteManager had (I assume) an open transaction, and b) every time I used the add-on to connect to the database, it did not destroy the previous one, which was no longer accessible.
我的问题原来是Firefox的SQLite Manager附加组件。我使用SysInternals“句柄”程序来确定a)Firefox / SQLiteManager(我假设)是一个打开的事务,而b)每次我使用附加组件连接到数据库时,它都没有破坏前一个,这是不再可访问的。
I exited Firefox, and my code ran fine. I loaded Firefox and SQLite Manager again, but did not begin a transaction; again, my code ran fine. My code was Python, not RoR.
我退出了Firefox,我的代码运行正常。我再次加载了Firefox和SQLite Manager,但没有开始交易;再次,我的代码运行良好。我的代码是Python,而不是RoR。
I would recommend this answer, and the original question be tagged for [sqlite3]. It's definitely not specific to RoR.
我会推荐这个答案,并为[sqlite3]标记原始问题。它绝对不是特定的RoR。
#1
It turned out that I forget use "sudo script/server"
to get write permission to the database :)
原来,我忘了使用“sudo script / server”来获取数据库的写权限:)
#2
I don't mean to resurrect the dead, but I just encountered this problem, and the popular answers I found did not apply.
我并不是要复活死者,但我刚刚遇到这个问题,我发现的流行答案并不适用。
My problem turned out to be the SQLite Manager add-on for Firefox. I used the SysInternals "handle" program to determine that a) Firefox/SQLiteManager had (I assume) an open transaction, and b) every time I used the add-on to connect to the database, it did not destroy the previous one, which was no longer accessible.
我的问题原来是Firefox的SQLite Manager附加组件。我使用SysInternals“句柄”程序来确定a)Firefox / SQLiteManager(我假设)是一个打开的事务,而b)每次我使用附加组件连接到数据库时,它都没有破坏前一个,这是不再可访问的。
I exited Firefox, and my code ran fine. I loaded Firefox and SQLite Manager again, but did not begin a transaction; again, my code ran fine. My code was Python, not RoR.
我退出了Firefox,我的代码运行正常。我再次加载了Firefox和SQLite Manager,但没有开始交易;再次,我的代码运行良好。我的代码是Python,而不是RoR。
I would recommend this answer, and the original question be tagged for [sqlite3]. It's definitely not specific to RoR.
我会推荐这个答案,并为[sqlite3]标记原始问题。它绝对不是特定的RoR。