无法添加可执行文件

时间:2016-07-27 16:19:14

标签: bash macos asdf-vm

我想做的事情:

# OR for Max OSX
echo '. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile

我做到了,然后:

MBP-slava:~ slava$ asdf plugin-list
-bash: asdf: command not found

然后我这样做了:

cd $HOME
touch .bash_profile
vim .bash_profile

#.bash_profile

. slava/.asdf/asdf.sh
. slava/.asdf/completions/asdf.bash
.
.
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~     

我试着:

. .bash_profile

哪个输出:

-bash: slava/.asdf/asdf.sh: No such file or directory
-bash: slava/.asdf/completions/asdf.bash: No such file or directory
-bash: .: filename argument required
.: usage: . filename [arguments]
-bash: .: filename argument required
.: usage: . filename [arguments]

然后:

MBP-slava:~ slava$ asdf plugin-list
-bash: asdf: command not found

OS X El Capitan

图书馆:https://github.com/asdf-vm/asdf

2 个答案:

答案 0 :(得分:0)

如果您的动机是添加可执行文件asdf.sh的路径 到PATH环境变量,然后执行

PATH="$PATH:$HOME/.asdf/"
echo "$PATH">>~/.bash_profile

启动新的终端会话 - 对于新的.bash_profile - 生效,并运行命令,如

asdf.sh # Autocomplete should work for this

答案 1 :(得分:0)

设置说明不正确-Homebrew公式的安装方式略有不同。路径(如果是Bash)是:

. /usr/local/opt/asdf/asdf.sh
. /usr/local/opt/asdf/etc/bash_completion.d/asdf.bash