-bash: vim: 命令未找到

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40836705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 15:27:54  来源:igfitidea点击:

-bash: vim: command not found

bash

提问by Jonnny

I have been trying to install something in my bash_profile, which looked like this:

我一直在尝试在我的 bash_profile 中安装一些东西,它看起来像这样:

# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc

I was trying to add the Path to my pg_config file: /Applications/Postgres.app/Contents/Versions/9.6/bin

我试图将路径添加到我的 pg_config 文件:/Applications/Postgres.app/Contents/Versions/9.6/bin

So my bash_profile looked like:

所以我的 bash_profile 看起来像:

# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:/Applications/Postgres.app/Contents/Versions/9.6/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc

When I tried to source the file i got:

当我尝试获取文件时,我得到了:

-bash: /usr/local/bin:/Applications/Postgres.app/Contents/Versions/9.6/bin:: No such file or directory

-bash: /usr/local/bin:/Applications/Postgres.app/Contents/Versions/9.6/bin:: 没有那个文件或目录

When I try to open the bash_profile I now get:

当我尝试打开 bash_profile 时,我现在得到:

-bash: vim: command not found

-bash: vim: 命令未找到

What have I done wrong?

我做错了什么?

Additional info

附加信息

I have installed Python, PGAdmin4 and Django via Homebrew I have downloaded Postgress.app also and was trying to install psycopg2, when it told me I had no pg_config. So I was trying to add the path to my bash_profile. Which I think is the right thing to do

我已经通过 Homebrew 安装了 Python、PGAdmin4 和 Django 我也下载了 Postgress.app 并试图安装 psycopg2,当它告诉我我没有 pg_config 时。所以我试图将路径添加到我的 bash_profile。我认为这是正确的做法

采纳答案by Jonnny

@melpomene and @Jdamian I think were right here. I had trouble trying to then find and open my bash_profile as I couldn't use the terminal to run:

@melpomene 和 @Jdamian 我认为就在这里。我在尝试查找并打开我的 bash_profile 时遇到了麻烦,因为我无法使用终端运行:

defaults write com.apple.finder AppleShowAllFiles YES

defaults write com.apple.finder AppleShowAllFiles YES

Thankfully this answer helped though: https://apple.stackexchange.com/a/186378/70982

值得庆幸的是,这个答案有所帮助:https: //apple.stackexchange.com/a/186378/70982

I navigated in finder to my ~/ folder and and ran ? CMD+? SHIFT+.

我在 finder 中导航到我的 ~/ 文件夹并运行 ? CMD+ ? SHIFT+.

Opened in sublime and My path had was written as this:

在崇高中打开,我的路径是这样写的:

export PATH=/usr/local/bin:/Applications/Postgres.app/Contents/Versions/9.6/bin: $PATH

export PATH=/usr/local/bin:/Applications/Postgres.app/Contents/Versions/9.6/bin: $PATH

So I removed the carriage return so it all fits on one line and that seemed to help. I can now open Vim

因此,我删除了回车符,使其全部放在一行上,这似乎有所帮助。我现在可以打开 Vim