$ bundle exec rake db:reset 命令提升无法删除 db/development.sqlite3 [英] $ bundle exec rake db:reset command raising couldn't drop db/development.sqlite3

查看:38
本文介绍了$ bundle exec rake db:reset 命令提升无法删除 db/development.sqlite3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I tried to run $ bundle exec rake db:reset and found the following on console

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

我该如何解决?

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

Edit I was following a tutorial and it tells me to run the above command to delete all the data from the database safely. And I am also using admin account.

推荐答案

当你做 db:reset,它正在运行 db:dropdb:setup 按顺序.您的错误信息表示无法删除db/development.sqlite.

When you do db:reset, it's running db:drop and db:setup in sequence. Your error message indicates that db/development.sqlite couldn't be deleted.

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

If you're on Windows, maybe you need to stop your Rails server and console. Otherwise, figure out what's preventing the file from being deleted. It could be permission problem. A reboot may solve the problem too.

这篇关于$ bundle exec rake db:reset 命令提升无法删除 db/development.sqlite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆