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

时间:2015-02-24 14:52:11

标签: ruby-on-rails ruby nginx capistrano unicorn

我正在尝试使用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.

我尝试在production.log目录(和/log)中创建文件chmod 0666 production.log并将其部署到服务器,但错误仍然存​​在。 我在那里错过了什么?

我在部署时遇到了一个错误:

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

我在服务器上检查了这个文件,其中包含以下内容:

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

该文件应具有哪些权限?

提前感谢您的帮助。

编辑:如果我登录服务器并在服务器上运行此命令 - touch production.log,我会touch: cannot touch 'production.log': Permission denied

1 个答案:

答案 0 :(得分:0)

尝试以下方法:

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