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. What am I missing there?
我试图在/ log目录(和chmod 0666 production.log)中创建文件production.log并将其部署到服务器,但错误仍然存在。我在那里错过了什么?
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
.
编辑:如果我登录到服务器并运行此命令 - 触摸服务器上的production.log,我会触摸:无法触摸'production.log':权限被拒绝。
1 个解决方案
#1
0
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
#1
0
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