我正在关注Michael Hartl的Rails教程,并且在某些时候我们要运行
rails db:migrate:reset
但是每次我都尝试这样做时,我面临着关于文件的权限被拒绝错误
development.sqlite3
我尝试过以下解决方案:
1. close all programs suspected of using said file and retry task
2. terminate rails console, server, editor and retry task
3. shut/restart pc and executing the task upon restart
4. executing rails db:drop
所有这些都无法允许命令运行.唯一可行的解决方案是手动删除文件并运行rails db:migrate
我在跑步
Rails 5.0.0.1
Ruby 2.2.5p319
Sqlite3 3.14.1
Windows 10 Professional
我的堆栈跟踪是:
**调用db:migrate:reset(first_time)
**调用db:drop(first_time)
**调用db:load_config(first_time)
**执行db:load_config
**调用db:check_protected_environments(first_time )
**调用环境(first_time )
**执行环境
**调用db:load_config
**执行db:check_protected_environments**执行db:
drop
**调用db:drop:_unsafe(first_time)
**调用db:load_config
**执行db:drop:_unsafe
权限被拒绝@ unlink_internal - %path%/ sample_app/db/development.sqlite3无法删除数据库'db/development.sqlite3'rails
aborted!
Errno :: EACCES:权限被拒绝@ unlink_internal …