I had Drush 4.
Then I deleted Drush folder and installed Drush 8 through Composer for my user.
drush command works on a server for my user.
Then I try to invoke drush from my local computer it does not work:
drush @myalias status -v Loaded alias @myalias from file /home/myuser/.drush/site-aliases/aliases.drushrc.php [notice] Begin redispatch via drush_invoke_process(). [notice] Calling proc_open(ssh myserver 'env COLUMNS=199 drush --verbose --uri=my.site.com --root=/my/web/path core-status 2>&1' 2>&1); env: drush: No such file or directory End redispatch via drush_invoke_process().
So I localized the problem - Drush does not work through SSH, but it works on the server under the same user.
ssh myalias 'drush' bash: drush: command not found
I tried unsuccessfully:
export PATH="$HOME/.composer/vendor/bin:$PATH" or
But it works:
ssh myalias '~/.composer/vendor/bin/drush'