git-deploy – Fix for /usr/bin/env: ruby: No such file or directory

Balaji D Loganathan

22 sec read

If you use git-deploy with rvm and if you face the error /usr/bin/env: ruby: No such file or directory then here is the quick fix that you can try.
add the lines
export rvmsudo_secure_path=1

to the file deploy/after_push before the run() function.
If you still the error then you can try to add the lines
source $HOME/.rvm/scripts/rvm
If you are using rbenv then you can add
export PATH=/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:"$PATH"
Note: make sure your deploy is an username in server for your deployments

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *