zsh:权限被拒绝:gam [英] zsh: permission denied: gam
问题描述
我在安装了Oh My ZSH的macOS 10.12上使用ZSH.
I am using ZSH on macOS 10.12 with Oh My ZSH installed.
我最近使用提供的安装脚本 bash<(curl -s -S -L https://git.io/install-gam)
I recently installed GAM on my computer using the provided install script bash <(curl -s -S -L https://git.io/install-gam)
该脚本将命令行工具 gam
安装到〜/bin/gam/gam
中,该文件位于我的 PATH
中.
The script installs the command line tool gam
to ~/bin/gam/gam
, which is in my PATH
.
但是,当尝试在ZSH中执行任何 gam
命令时,我得到以下信息:
However, when trying to execute any gam
command in ZSH, I get the following:
➜ ~ gam info user
zsh: permission denied: gam
但是,当在bash中执行相同(或任何)命令时,该工具将按预期工作.
However, when executing the same (or any) command in bash, the tool works as expected.
我已经可以通过将 alias gam =〜/bin/gam/gam"
放入我的 .zshrc
中来使命令正常工作,但这会导致一些问题以〜
开头的gam参数出现意外问题.
I have been able to get the command to work by placing alias gam="~/bin/gam/gam"
in my .zshrc
, but this causes some unexpected issues with gam arguments beginning with ~
.
〜/bin/gam/gam
具有执行特权及其随附的文件夹〜/bin/gam/
,所以我不知道这里出了什么问题
~/bin/gam/gam
has execute privileges as well as its accompanying folder ~/bin/gam/
, so I can't figure out what's wrong here.
推荐答案
〜/bin/
在我的 PATH
中,但是子文件夹〜/bin/gam/
不是.调用 gam
将导致ZSH找到文件夹〜/bin/gam/
并尝试执行该文件夹,因此, permission否认
错误而不是找不到命令
.
~/bin/
was in my PATH
but the subfolder ~/bin/gam/
was not. Calling gam
would cause ZSH to find the folder ~/bin/gam/
and try to execute it, hence the permission denied
error instead of command not found
.
gam
在BASH中工作的原因是因为安装脚本仅将〜/bin/gam/
添加到了中的
而不是 PATH
中.bashrc .zshrc
The reason gam
worked in BASH was because the install script only added ~/bin/gam/
to my PATH
in .bashrc
and not .zshrc
这篇关于zsh:权限被拒绝:gam的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!