Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'chcp' is not recognized as an internal or external command, operable program or batch file. on a Windows PC

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:\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.

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!

like image 534
Abundnce10 Avatar asked Nov 15 '11 19:11

Abundnce10


2 Answers

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

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

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 enter image description here

like image 57
manojlds Avatar answered Oct 05 '22 10:10

manojlds


You have broken PATH (check with SET PATH), chcp is internal Windows-command, which can be found in $Windows\system32\ dir

like image 28
Lazy Badger Avatar answered Oct 05 '22 11:10

Lazy Badger