Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database is locked?

How do I fix a database lock..since my test isn't passing - it's making a bunch of tests in the same category fail. thanks!

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', '[email protected]', '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)>'
like image 913
Matthew Berman Avatar asked May 29 '11 04:05

Matthew Berman


Video Answer


1 Answers

This is due to a Rails Console Session being open. To get around this in the future be sure to bin/rails console -s and when accessing the SQLite 3 DB ensure to exit any console sessions.

like image 80
ChuckJHardy Avatar answered Sep 21 '22 18:09

ChuckJHardy