简体   繁体   中英

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....

But at the final step of deployment . Capistrano exists out with this error:

 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.

Note: rvm-shell is installed in ~/.rvm/bin . So it is not the same error as mentioned here : 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 . 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.

Hope my Answer would help other people if they Get similar kind of error and save lot of their time. :)

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