简体   繁体   English

Capistrano部署失败:/etc/init.d/unicorn:第42行:找不到rvm-shell命令

[英]Capistrano Deployment failure : /etc/init.d/unicorn: line 42: rvm-shell command not found

I am deploying to Server using Unicorn, and capistrano in rails.... 我正在使用Unicorn和capistrano部署到Server。

But at the final step of deployment . 但是在部署的最后一步。 Capistrano exists out with this error: Capistrano存在此错误:

 INFO [47010f4f] Running /usr/bin/env service unicorn_app restart on xyzdomain.com
DEBUG [47010f4f] Command: service unicorn_app restart
DEBUG [47010f4f]    Couldn't reload, starting 'cd /var/www/app/current; rvm-shell 'default' -c 'bundle exec unicorn -D -c /var/www/app/shared/config/unicorn.rb -E staging'' instead
DEBUG [47010f4f]    
DEBUG [47010f4f]    /etc/init.d/unicorn_app: line 42: rvm-shell: command not found
DEBUG [47010f4f]    
cap aborted!

When I run rvm-shell command from terminal on the Server, it runs without error. 当我从服务器上的终端运行rvm-shell命令时,它运行无误。

Note: rvm-shell is installed in ~/.rvm/bin . 注意: rvm-shell安装在〜/ .rvm / bin中。 So it is not the same error as mentioned here : https://github.com/capistrano/capistrano/issues/43 所以它不是这里提到的错误: https : //github.com/capistrano/capistrano/issues/43

Why is this happening? 为什么会这样呢?

Resolved the Problem: 解决了问题:

It was actually some Permissions problem on the Server. 实际上,这是服务器上的一些权限问题

When I executed the command , which was failing directly on Server, it produced some directory permission errors . 当我执行直接在Server上失败的命令时 ,它产生了一些目录权限错误 I resolved them by creating those directories manually. 我通过手动创建这些目录来解决它们。

cd /var/www/app/shared
mkdir pids
mkdir logs

Strangely Capistrano didn't display specific failure errors when deployment failed , which led to a lot of confusion and wasted time to debug. 奇怪的是,在部署失败时 ,Capistrano 没有显示特定的失败错误 ,这导致了很多混乱,浪费了调试时间。

Hope my Answer would help other people if they Get similar kind of error and save lot of their time. 希望我的答案可以帮助其他人,如果他们遇到类似的错误并节省很多时间。 :) :)

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

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