gpt4 book ai didi

osx-lion - 将目录添加到 .zshrc 中的路径

转载 作者:行者123 更新时间:2023-12-03 15:25:25 27 4
gpt4 key购买 nike

这个问题不太可能对任何 future 的访客有帮助;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于互联网的全局受众。如需帮助使这个问题更广泛适用,visit the help center .




8年前关闭。




我已经在这个问题上讨论了几天了。我用 zsh并且需要设置一个目录路径,以便识别我使用的命令。到目前为止,请遵循以下步骤:

cd ~

ls -al
ls -al向我展示这些文件:
.oh-my-zsh
.profile
.putty
.rediscli_history
.ringo-history
.ssh
.subversion
.viminfo
.zcompdump
.zsh-update
.zsh_history
.zshrc

我假设我需要将路径添加到 .zshrc , 所以:
open -e .zshrc

在文件的末尾,我添加了将用于设置我的项目的命令的路径(使用 ringojs):
export PATH=Users/repos/ringojs/bin/:$PATH

关闭文件,重新启动终端应用程序,重新启动计算机,但是找不到位于上述路径( ringo-admin )下的命令( /Users/repos/ringojs/bin ):
ringo-admin create --google-appengine MyAppName
zsh: command not found: ringo-admin

请帮助我,如果有帮助,这是我的 .zshrc文件内容:
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"

# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"

# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13

# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)

source $ZSH/oh-my-zsh.sh

# Customize to your needs...
export PATH=Users/repos/ringojs/bin/ringo-admin:$PATH

请逐步指导我,因为我是 zsh 的新手.谢谢。

更新:

echo $PATH 显示我最近添加的目录:
/Users/repos/ringojs/bin/ringo-admin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin

我不明白为什么总是找不到命令。

最佳答案

您缺少前导斜杠。尝试:

export PATH=/Users/repos/ringojs/bin/:$PATH

关于osx-lion - 将目录添加到 .zshrc 中的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14023484/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com