gpt4 book ai didi

ruby-on-rails - $ bundle exec rake db :reset command raising couldn't drop db/development. sqlite3

转载 作者:IT王子 更新时间:2023-10-29 06:17:53 27 4
gpt4 key购买 nike

我尝试运行 $ bundle exec rake db:reset 并在控制台上发现以下内容

Couldn't drop db/development.sqlite3 : #<Errno::EACCES: Permission denied - c:/sample_app/db/development.sqlite3>
db/development.sqlite3 already exists
-- create_table("users", {:force=>true})
-> 0.3940s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true})

-> 0.1280s
-- initialize_schema_migrations_table()
-> 0.0010s
-- assume_migrated_upto_version(20120419034627, ["c:/sample_app/db/migrate
"])
-> 0.0040s

我该如何解决?

编辑 我正在学习一个教程,它告诉我运行上面的命令以安全地从数据库中删除所有数据。我也在使用管理员帐户。

最佳答案

当你做 db:reset , 它依次运行 db:dropdb:setup 。你的error message表示无法删除db/development.sqlite

如果您使用的是 Windows,也许您需要停止 Rails 服务器和控制台。否则,找出阻止文件被删除的原因。可能是权限问题。重新启动也可能会解决问题。

关于ruby-on-rails - $ bundle exec rake db :reset command raising couldn't drop db/development. sqlite3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10290557/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com