简体   繁体   中英

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)

2) FileUtils.rm_rf(filename)

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

In production environment what is your user and what permissions he has. First check permission for that user than proceed further.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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