数据库已被锁定?

时间:2011-05-29 04:06:42

标签: ruby-on-rails

如何修复数据库锁...因为我的测试没有通过 - 它在同一类别中进行了一系列测试失败。谢谢!

1) UsersController GET 'edit' should have a link to change the Gravatar
     Failure/Error: @user = Factory(:user)
     SQLite3::BusyException: database is locked: INSERT INTO "users" ("created_at", "email", "encrypted_password", "name", "salt", "updated_at") VALUES ('2011-05-29 03:47:07.510067', 'mberman84@gmail.com', 'fc70fcb4b094b388d87c5054ed9b0bfa06f53431d44c527e852c5bdffd3a0fa8', 'Matthew Berman', NULL, '2011-05-29 03:47:07.510067')
     # ./spec/controllers/users_controller_spec.rb:128:in `block (3 levels) in <top (required)>'

1 个答案:

答案 0 :(得分:17)

这是由于Rails控制台会话正在打开。为了在将来解决这个问题,请确保bin/rails console -s并且在访问SQLite 3 DB时确保退出任何控制台会话。