If I ssh into my VPS as the deployment user and run bundle -v
I get Bundler version 1.1.5
as expected.
If I run ssh [email protected] bundle -v
, then I see bash: bundle: command not found
Why isn't bundle being shown running commands via ssh?
More Info
$ cat ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
if [ -d "${RBENV_ROOT}" ]; then
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
fi
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
When you run:
ssh [email protected]
You get a login shell on the remote host, which means that your shell will run (...for bash...) .bash_profile
or .profile
or equivalent AS WELL AS your per-shell initialization file.
When you run:
ssh [email protected] some_command
This does not start a login shell, so it only runs the per-shell initialization file (e.g., .bashrc
).
The problem you've described typically means that you need something in your .profile
file (typically an environment variable setting) for everything to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With