无法删除我的数据库 - 文本文件繁忙的db / development.sqlite3

时间:2015-01-06 03:10:40

标签: ruby-on-rails sqlite

我是编程新手,正在使用Ruby on Rails构建一个简单的wiki共享应用程序。每次我尝试运行rake db:drop时,我都会得到这个堆栈跟踪:

Text file busy - /home/vagrant/code/blocipedia/db/development.sqlite3
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1433:in `unlink'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1433:in `block in remove_file'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1438:in `platform_support'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1432:in `remove_file'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:785:in `remove_file'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:563:in `block in rm'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:562:in `each'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:562:in `rm'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/sqlite_database_tasks.rb:22:in `drop'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:98:in `drop'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:110:in `block in drop_current'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:183:in `block in each_current_configuration'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:182:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:182:in `each_current_configuration'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:109:in `drop_current'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/railties/databases.rake:35:in `block (2 levels) in <top (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/bin/rake:23:in `load'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/bin/rake:23:in `<main>'
Couldn't drop db/development.sqlite3

有关如何解决此问题的任何想法?我尝试先运行rake db:migrate,但最终还是遇到了同样的问题。

0 个答案:

没有答案