Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle not found via ssh

Tags:

ssh

bundler

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
like image 813
Chris Avatar asked Jul 30 '12 22:07

Chris


1 Answers

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.

like image 165
larsks Avatar answered Nov 13 '22 02:11

larsks