简体   繁体   English

删除文件在Rails的生产ruby中被拒绝的权限

[英]Delete file Permission denied in production ruby on rails

I am struggling to delete a file in production mode.I have tried several options that are 我正在努力以生产模式删除文件。我尝试了以下几种方法:

1) File.delete(filename) 1)File.delete(文件名)

2) FileUtils.rm_rf(filename) 2)FileUtils.rm_rf(文件名)

It says permission denied in production mode when i run in development it works fine.Also when i explicitly run chmod -R 777 on the folder where the file exists it lets me delete the file.I have tried with File.chmod option but it isn't working 它说我在开发环境中运行时在生产模式下拒绝权限可以正常工作。另外,当我在文件所在的文件夹中显式运行chmod -R 777时,它允许我删除该文件。我尝试使用File.chmod选项,但它不是没有工作

In production environment what is your user and what permissions he has. 在生产环境中,您的用户是谁,他具有什么权限。 First check permission for that user than proceed further. 首先检查该用户的权限,然后再继续。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM