gpt4 book ai didi

windows - 'chcp' 不是内部或外部命令,也不是可运行的程序或批处理文件。在 Windows PC 上

转载 作者:可可西里 更新时间:2023-11-01 13:00:04 27 4
gpt4 key购买 nike

使用 git init 命令时,我在命令提示符中收到以下错误消息。我使用的是运行 Windows 7 的 Windows PC。

C:\rails_projects\first_app>git init
'chcp' is not recognized as an internal or external command,
operable program or batch file.
Reinitialized existing Git repository in C:/rails_projects/first_app/.git/
'chcp' is not recognized as an internal or external command,
operable program or batch file.

我是 Ruby on Rails 的新手,我正在尝试为我的 Rails 项目创建一个存储库。当我使用诸如 rails new first_apprails server 之类的命令时,我没有收到消息,只有当我使用 git init 命令时它出现了吗?此外,如您所见,该命令仍然正常运行(即 Reinitialized existing Git repository in C:/rails_projects/first_app/.git/),但是,每次我创建时看到错误消息很烦人一个命令。

有人知道如何解决这个问题吗?我找到了一个链接,告诉我需要将控制台切换到 Windows-1252 http://illegalargumentexception.blogspot.com/2009/04/i18n-unicode-at-windows-command-prompt.html#charsets_1252但这没有用。

感谢任何帮助,谢谢!

最佳答案

查看您的 PATH 环境变量是否设置正确。任何系统都应该至少在 PATH 上有以下内容

;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

如果上面没有,请添加。

添加后,打开一个新的 cmd/bash 并尝试:

where chcp

它应该给出路径。

然后再次尝试 git init

编辑

如果您需要帮助找到添加位置 enter image description here

关于windows - 'chcp' 不是内部或外部命令,也不是可运行的程序或批处理文件。在 Windows PC 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8142058/

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