The Chef installer for Windows adds
ruby.exe and to
PATH. If you have installed ruby environment, which ruby is used when you enter
ruby to your MS-DOS prompt?
To avoid such problem, I created a Chef console with a simple bat file.
Chef adds two folders to PATH
When you install Chef client (http://www.getchef.com/chef/install/), many files are deployed to
C:\opscode\chef and the following 2 folders are added to
Chef related programs such as
UNIX related programs such as
Conflicts with existing Ruby environment
C:\Ruby200-x64\bin which is added to
Which ruby is used when I run
gem install xxxx from my MS-DOS prompt?
If we first install Ruby and then install Chef,
C:\Ruby200-x64\bin\gem is executed.
If we first install Chef and then install Ruby,
C:\opscode\chef\embedded\bin\gem is executed.
It's very confusing.
Let's use Chef console
To solve this problem, I created a "Chef console".
1. Create a bat file
Save following file as
@ECHO OFF SET PATH=c:\opscode\chef\bin;c:\opscode\chef\embedded\bin SET PATH=%PATH%;c:\windows\system32;c:\windows title Chef Env chef-solo -v
2. Create a shortcut file
Create a shortcut file to this bat.
C:\Windows\System32\cmd.exe /K C:\opscode\chefenv.bat
- Start in: Anywhere. (My document, path to chef repository and so on)
/K means "Carries out the command specified by string and continues.")
How to use
When you double click the shortcut file, a command prompt appears with restricted
You can execute
Now, you can safely remove