问题描述
我正在遵循Michael Hartl编写的Rails教程,在某些时候我们要运行 rails db:migrate:reset
但是,每次我尝试这样做时,都会遇到与文件有关的权限被拒绝的错误
I am following the Rails Tutorial by Michael Hartl, and at certain points we are to runrails db:migrate:reset
However each time I do try to do so I am faced with a permission denied error concerning the file
我尝试了以下遇到的解决方案: 1.关闭所有怀疑使用该文件的程序,然后重试任务
2.终止Rails控制台,服务器,编辑器并重试任务
3.关闭/重新启动电脑,并在重新启动时执行任务
4.执行rails db:drop
I have tried the following solutions I've encountered: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
All of which have failed to allow the command to run. The only working solution is to delete the file manually and running rails db:migrate
我正在跑步
我的堆栈跟踪为:
如何删除此错误并在以后的项目中防止它出现?
How can I remove this error and prevent it for future projects?
推荐答案
我使用Windows 10 Pro遇到相同的错误|红宝石2.4.1 |Rails 5.1.4.我使用以下方法进行播种:
I get the same error using Windows 10 Pro | ruby 2.4.1 | Rails 5.1.4. I soved using:
rake db:drop:_unsafe
rake db:create
rake db:migrate
这篇关于Rails db:migrate:reset产生Errno :: EACCES权限被拒绝@unlink_internal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!