SSH âcommand not foundâ for Zsh
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Im using Zsh on the client and server. When I use ssh to run a command on the remote server it can not find the binary:
ssh gt "cd /home/****/app/staging && bundle exec rake db:migrate RAILS_ENV=staging"
zsh:1: command not found: bundle
I can run the same command fine if I SSH in with an interactive shell.
On the server the $PATH
is set in both .zshrc and .zshenv
EDIT
It appears bundle
is not in my $PATH on the server. Maybe this has something to do with RVM (Ruby Version Manager) which hooks in to cd
, so when you cd
in to a directory with a .rvmrc
file it sets up the Ruby environment and adds bundle
to the $PATH. I need to find out if the cd
hook is also triggered for non-interactive shells.
ssh zsh
add a comment |Â
up vote
0
down vote
favorite
Im using Zsh on the client and server. When I use ssh to run a command on the remote server it can not find the binary:
ssh gt "cd /home/****/app/staging && bundle exec rake db:migrate RAILS_ENV=staging"
zsh:1: command not found: bundle
I can run the same command fine if I SSH in with an interactive shell.
On the server the $PATH
is set in both .zshrc and .zshenv
EDIT
It appears bundle
is not in my $PATH on the server. Maybe this has something to do with RVM (Ruby Version Manager) which hooks in to cd
, so when you cd
in to a directory with a .rvmrc
file it sets up the Ruby environment and adds bundle
to the $PATH. I need to find out if the cd
hook is also triggered for non-interactive shells.
ssh zsh
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Im using Zsh on the client and server. When I use ssh to run a command on the remote server it can not find the binary:
ssh gt "cd /home/****/app/staging && bundle exec rake db:migrate RAILS_ENV=staging"
zsh:1: command not found: bundle
I can run the same command fine if I SSH in with an interactive shell.
On the server the $PATH
is set in both .zshrc and .zshenv
EDIT
It appears bundle
is not in my $PATH on the server. Maybe this has something to do with RVM (Ruby Version Manager) which hooks in to cd
, so when you cd
in to a directory with a .rvmrc
file it sets up the Ruby environment and adds bundle
to the $PATH. I need to find out if the cd
hook is also triggered for non-interactive shells.
ssh zsh
Im using Zsh on the client and server. When I use ssh to run a command on the remote server it can not find the binary:
ssh gt "cd /home/****/app/staging && bundle exec rake db:migrate RAILS_ENV=staging"
zsh:1: command not found: bundle
I can run the same command fine if I SSH in with an interactive shell.
On the server the $PATH
is set in both .zshrc and .zshenv
EDIT
It appears bundle
is not in my $PATH on the server. Maybe this has something to do with RVM (Ruby Version Manager) which hooks in to cd
, so when you cd
in to a directory with a .rvmrc
file it sets up the Ruby environment and adds bundle
to the $PATH. I need to find out if the cd
hook is also triggered for non-interactive shells.
ssh zsh
ssh zsh
edited Nov 4 '11 at 13:16
asked Nov 4 '11 at 10:33
Kris
13519
13519
add a comment |Â
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
2
down vote
accepted
The path in which your binary is, is probably added to the $PATH
variable on login. And when you run the presented command, it is executed via a non-login shell. The easiest (and safe) way of solving this is to specify a full path in this case.
3
As I readman zsh
, the file sourced by non-login shells is.zshenv
. This means thatbundle
is not found in the$PATH
set in that file. Do a simple checkssh gt 'echo $PATH'
(mind the single quotes!).
â rozcietrzewiacz
Nov 4 '11 at 10:59
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
add a comment |Â
up vote
0
down vote
the reason is the PATH here.
please do a which bundle
, on both the shells, that should be self-explanatory ! and you could either edit the PATH variable exporting it to your needs, or use absolute paths for the same.
add a comment |Â
up vote
0
down vote
I upvoted the comment by @rozcietrewiacz, but I want to call it out as a full answer. (This wouldn't have helped the poster who had already set both dotfiles, but I think it will help people like me who find this question based on the error.)
zsh
reads .zshenv
and .zshrc
for interactive logins, but only .zshenv
for noninteractive logins. To fix this problem, I needed to split out the PATH settings from my .zshrc
and move them to .zshenv
.
In my case, I was unable to run mercurial commands that communicated by ssh with another server, because my path (with hg
itself) was set in .zshrc
on the server.
More detail can be found here and here.
add a comment |Â
up vote
0
down vote
"""
To fix this problem, I needed to split out the PATH settings from my .zshrc and move them to .zshenv.
"""
it works! fix my problem!
New contributor
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
The path in which your binary is, is probably added to the $PATH
variable on login. And when you run the presented command, it is executed via a non-login shell. The easiest (and safe) way of solving this is to specify a full path in this case.
3
As I readman zsh
, the file sourced by non-login shells is.zshenv
. This means thatbundle
is not found in the$PATH
set in that file. Do a simple checkssh gt 'echo $PATH'
(mind the single quotes!).
â rozcietrzewiacz
Nov 4 '11 at 10:59
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
add a comment |Â
up vote
2
down vote
accepted
The path in which your binary is, is probably added to the $PATH
variable on login. And when you run the presented command, it is executed via a non-login shell. The easiest (and safe) way of solving this is to specify a full path in this case.
3
As I readman zsh
, the file sourced by non-login shells is.zshenv
. This means thatbundle
is not found in the$PATH
set in that file. Do a simple checkssh gt 'echo $PATH'
(mind the single quotes!).
â rozcietrzewiacz
Nov 4 '11 at 10:59
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
The path in which your binary is, is probably added to the $PATH
variable on login. And when you run the presented command, it is executed via a non-login shell. The easiest (and safe) way of solving this is to specify a full path in this case.
The path in which your binary is, is probably added to the $PATH
variable on login. And when you run the presented command, it is executed via a non-login shell. The easiest (and safe) way of solving this is to specify a full path in this case.
answered Nov 4 '11 at 10:50
rozcietrzewiacz
28.3k37191
28.3k37191
3
As I readman zsh
, the file sourced by non-login shells is.zshenv
. This means thatbundle
is not found in the$PATH
set in that file. Do a simple checkssh gt 'echo $PATH'
(mind the single quotes!).
â rozcietrzewiacz
Nov 4 '11 at 10:59
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
add a comment |Â
3
As I readman zsh
, the file sourced by non-login shells is.zshenv
. This means thatbundle
is not found in the$PATH
set in that file. Do a simple checkssh gt 'echo $PATH'
(mind the single quotes!).
â rozcietrzewiacz
Nov 4 '11 at 10:59
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
3
3
As I read
man zsh
, the file sourced by non-login shells is .zshenv
. This means that bundle
is not found in the $PATH
set in that file. Do a simple check ssh gt 'echo $PATH'
(mind the single quotes!).â rozcietrzewiacz
Nov 4 '11 at 10:59
As I read
man zsh
, the file sourced by non-login shells is .zshenv
. This means that bundle
is not found in the $PATH
set in that file. Do a simple check ssh gt 'echo $PATH'
(mind the single quotes!).â rozcietrzewiacz
Nov 4 '11 at 10:59
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
It looks like single quotes may have been the issue, changing from double quotes to single seems to have fixed the issue.
â Kris
Nov 4 '11 at 13:48
add a comment |Â
up vote
0
down vote
the reason is the PATH here.
please do a which bundle
, on both the shells, that should be self-explanatory ! and you could either edit the PATH variable exporting it to your needs, or use absolute paths for the same.
add a comment |Â
up vote
0
down vote
the reason is the PATH here.
please do a which bundle
, on both the shells, that should be self-explanatory ! and you could either edit the PATH variable exporting it to your needs, or use absolute paths for the same.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
the reason is the PATH here.
please do a which bundle
, on both the shells, that should be self-explanatory ! and you could either edit the PATH variable exporting it to your needs, or use absolute paths for the same.
the reason is the PATH here.
please do a which bundle
, on both the shells, that should be self-explanatory ! and you could either edit the PATH variable exporting it to your needs, or use absolute paths for the same.
answered Nov 4 '11 at 10:52
Gaumire
1,07173
1,07173
add a comment |Â
add a comment |Â
up vote
0
down vote
I upvoted the comment by @rozcietrewiacz, but I want to call it out as a full answer. (This wouldn't have helped the poster who had already set both dotfiles, but I think it will help people like me who find this question based on the error.)
zsh
reads .zshenv
and .zshrc
for interactive logins, but only .zshenv
for noninteractive logins. To fix this problem, I needed to split out the PATH settings from my .zshrc
and move them to .zshenv
.
In my case, I was unable to run mercurial commands that communicated by ssh with another server, because my path (with hg
itself) was set in .zshrc
on the server.
More detail can be found here and here.
add a comment |Â
up vote
0
down vote
I upvoted the comment by @rozcietrewiacz, but I want to call it out as a full answer. (This wouldn't have helped the poster who had already set both dotfiles, but I think it will help people like me who find this question based on the error.)
zsh
reads .zshenv
and .zshrc
for interactive logins, but only .zshenv
for noninteractive logins. To fix this problem, I needed to split out the PATH settings from my .zshrc
and move them to .zshenv
.
In my case, I was unable to run mercurial commands that communicated by ssh with another server, because my path (with hg
itself) was set in .zshrc
on the server.
More detail can be found here and here.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I upvoted the comment by @rozcietrewiacz, but I want to call it out as a full answer. (This wouldn't have helped the poster who had already set both dotfiles, but I think it will help people like me who find this question based on the error.)
zsh
reads .zshenv
and .zshrc
for interactive logins, but only .zshenv
for noninteractive logins. To fix this problem, I needed to split out the PATH settings from my .zshrc
and move them to .zshenv
.
In my case, I was unable to run mercurial commands that communicated by ssh with another server, because my path (with hg
itself) was set in .zshrc
on the server.
More detail can be found here and here.
I upvoted the comment by @rozcietrewiacz, but I want to call it out as a full answer. (This wouldn't have helped the poster who had already set both dotfiles, but I think it will help people like me who find this question based on the error.)
zsh
reads .zshenv
and .zshrc
for interactive logins, but only .zshenv
for noninteractive logins. To fix this problem, I needed to split out the PATH settings from my .zshrc
and move them to .zshenv
.
In my case, I was unable to run mercurial commands that communicated by ssh with another server, because my path (with hg
itself) was set in .zshrc
on the server.
More detail can be found here and here.
answered Mar 8 '17 at 17:11
Joshua Goldberg
1212
1212
add a comment |Â
add a comment |Â
up vote
0
down vote
"""
To fix this problem, I needed to split out the PATH settings from my .zshrc and move them to .zshenv.
"""
it works! fix my problem!
New contributor
add a comment |Â
up vote
0
down vote
"""
To fix this problem, I needed to split out the PATH settings from my .zshrc and move them to .zshenv.
"""
it works! fix my problem!
New contributor
add a comment |Â
up vote
0
down vote
up vote
0
down vote
"""
To fix this problem, I needed to split out the PATH settings from my .zshrc and move them to .zshenv.
"""
it works! fix my problem!
New contributor
"""
To fix this problem, I needed to split out the PATH settings from my .zshrc and move them to .zshenv.
"""
it works! fix my problem!
New contributor
New contributor
answered 5 mins ago
wallen wan
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f23947%2fssh-command-not-found-for-zsh%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password