

- USR/LOCAL/BIN/VIRTUALENVWRAPPER.SH NO SUCH FILE OR DIRECTORY INSTALL
- USR/LOCAL/BIN/VIRTUALENVWRAPPER.SH NO SUCH FILE OR DIRECTORY UPDATE
- USR/LOCAL/BIN/VIRTUALENVWRAPPER.SH NO SUCH FILE OR DIRECTORY FULL
USR/LOCAL/BIN/VIRTUALENVWRAPPER.SH NO SUCH FILE OR DIRECTORY UPDATE
You should probably make sure at update the command= to be command="/bin/sh /path/to/your/script." if you haven't already to make sure your script is run by the right shell. This debug output will confirm/deny my theory. I am guessing that the way your deploy script is called, $PATH is not set as you would expect. It is clear that you have a path problem since your deploy script can't find things that are definitely on the path when you do a normal ssh login.įirst thing to do to confirm you have a PATH issue is to update your deploy script to log the output of env or at least echo $PATH.
USR/LOCAL/BIN/VIRTUALENVWRAPPER.SH NO SUCH FILE OR DIRECTORY FULL
Both env and full paths have their benefits and drawbacks but, in this case, the path is safer: #!/usr/bin/php In any case, the simple solution is to use the full path to the interpreter instead of env. Therefore, the $PATH that your script has access to when run with ssh is not the same as when you log in to test it. usr/bin:/usr/local/sbin:/usr/local/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl: You can check this by running this command (note the single quotes): ssh 'echo $PATH'Īnd comparing the output to what you get if you ssh and then run echo $PATH. In your case, that's almost certainly because when running a command over ssh, you don't start a full shell and don't actually read your shell's initialization files. So, /usr/bin/env php will look for an executable file called php in any of the directories in the $PATH of the user running it. The env command will look through a user's $PATH to find the first executable of the given name.
USR/LOCAL/BIN/VIRTUALENVWRAPPER.SH NO SUCH FILE OR DIRECTORY INSTALL
P.S.: Similar error ( /usr/bin/env: node: No such file or directory) occurs when there is bower install (using Bower), but not when running npm install (using NPM). I spent 12 hours of debugging it and I am out of ideas here. So this seems to me as very specific case, why this command does not work. running failing commands directly - also perfectly without errors.running the script directly as bash deploy.sh under root (since it is same as that user) - works perfectly without errors.$PATH contains /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games.php5-cli package is installed and newest version.whereis php displays php: /usr/bin/php /usr/local/bin/php /usr/share/man/man1/php.1.gz./usr/bin/env php -v displays correct PHP version (same as /usr/bin/php -v).

Before this line, there is also called /bin/composer self-update and /bin/composer -V, which both runs correctly and displays correct output. Things are more weird the more I look on that script. The script reports /usr/bin/env: php: No such file or directory at command /bin/composer install (using Composer). The user deployer has uid=0, so its basically root (this will be changed in the future, I have set it only to eliminate permissions problems until it works fine).Īnd here is where the things get tricky. So basically I just call ssh someArguments and it runs my script with someArguments as parameters.

Access to this script is done through ssh, using this tutorial, I have set up ssh login, that runs that script.

That script is on my home server (Ubuntu 15.10 Server), marked as executable.
