简体   繁体   English

Capistrano-Rails错误:无法访问日志文件+独角兽:权限被拒绝

[英]Capistrano - Rails Error: Unable to access log file + unicorn: Permission denied

I am trying to deploy code with using Capistrano and facing these error: 我正在尝试使用Capistrano部署代码并遇到以下错误:

 ** [out :: IP] Rails Error: Unable to access log file. Please ensure that /home/deployer/apps/projectname_production/releases/20150224143955/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

I've tried to create the file production.log in the /log directory (and chmod 0666 production.log ) and deployed it to the server, but the error is still there. 我尝试在/log目录(和chmod 0666 production.log )中创建文件production.log并将其部署到服务器,但是错误仍然存​​在。 What am I missing there? 我在那里想念什么?

I faced one more error while deployment: 部署时我又遇到了一个错误:

 ** [out :: IP] bash: /etc/init.d/unicorn_projectname: Permission denied

I checked this file on the server and there's following: 我在服务器上检查了此文件,并且有以下内容:

lrwxrwxrwx  1 root root   68 Feb 24 14:20 unicorn_projectname -> /home/deployer/apps/projectname_production/current/config/unicorn_init.sh

What permissions should have this file? 该文件应具有什么权限?

Thank you in advance for help. 预先感谢您的帮助。

EDIT: if I log in to the server and run this command - touch production.log on the server, I get touch: cannot touch 'production.log': Permission denied . 编辑:如果我登录到服务器并运行此命令- touch production.log服务器上的touch production.log ,我会得到touch: cannot touch 'production.log': Permission denied

Try the following: 请尝试以下操作:

sudo touch /home/deployer/apps/projectname_production/releases/20150224143955/log/production.log

sudo chmod 0666 /home/deployer/apps/projectname_production/releases/20150224143955/log/production.log

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

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