'chcp' 不是内部或外部命令,也不是可运行的程序或批处理文件.在 Windows PC 上 [英] 'chcp' is not recognized as an internal or external command, operable program or batch file. on a Windows PC

查看:114
本文介绍了'chcp' 不是内部或外部命令,也不是可运行的程序或批处理文件.在 Windows PC 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

C:
ails_projectsfirst_app>git init'chcp' 未被识别为内部或外部命令,可运行的程序或批处理文件.在 C:/rails_projects/first_app/.git/中重新初始化现有的 Git 存储库'chcp' 未被识别为内部或外部命令,可运行的程序或批处理文件.

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

有人知道如何解决这个问题吗?我发现一个链接告诉我我需要将控制台切换到 Windows-1252

I am receiving the error message below in the command prompt when using the git init command. I'm using a Windows PC running Windows 7.

C:
ails_projectsfirst_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.

I'm new to Ruby on Rails and I'm trying to create a repository for my Rails project. When I use a command such as rails new first_app or rails server I don't receive the message, only when I used the git init command does it show up. Also, as you can see the command still functions correctly (i.e. Reinitialized existing Git repository in C:/rails_projects/first_app/.git/), however, it's annoying to see the error message every time I make a command.

Does anyone have any idea how to fix this problem? I found a link that told me I need to switch the console to Windows-1252 http://illegalargumentexception.blogspot.com/2009/04/i18n-unicode-at-windows-command-prompt.html#charsets_1252 but that didn't work.

I appreciate any help, thanks!

解决方案

See if your PATH environment variable is setup properly. Any system should have atleast the below on PATH

;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;

Add the above if not there.

Once added, open a new cmd / bash and try:

where chcp

It should give the path.

Then try with the git init again

Edit

If you need help to find where to add it

这篇关于'chcp' 不是内部或外部命令,也不是可运行的程序或批处理文件.在 Windows PC 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆