RailsTutorial第6章,Rake Aborted

时间:2013-05-08 17:09:46

标签: ruby-on-rails sqlite rake

在rails教程第6章中,当我尝试迁移时,我收到此错误:

MacBook-Pro-de-Stephane-Cedroni:sample_app stephanecedroni$ bundle exec rake db:migrate
==  AddIndexToUsersEmail: migrating ===========================================
-- add_index(:users, :email, {:unique=>true})
   -> 0.0020s
==  AddIndexToUsersEmail: migrated (0.0022s) ==================================

rake aborted!
An error has occurred, this and all later migrations canceled:

SQLite3::BusyException: database is locked: commit transaction/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:97:in `close'

有人有同样的错误吗? 我不是很有经验,需要你的帮助!

由于

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。

我有另一个打开的控制台窗口,我正在运行“rails console --sandbox”,因此我阻止了对数据库的任何更改。关闭此窗口后,我可以进行迁移。

也许这会对你有帮助!