| CentOS 5 users! You should follow the instructions for Installation on RHEL and CentOS 5 with RPMs as they are well tested. |
Centos4 has a problem with installing gems from source since the included version of Ruby is very old.
This page describes how to set up the CentOS Testing repository to get a usable version of Ruby.
Create Yum Repository
Create the file, /etc/yum.repos.d/CentOS-Testing.repo with your favorite text editor with the following contents.
Install GCC and G++
To compile native extensions for some Gems, we'll need GCC and G++, as well as for Chef Server to compile the Apache module for Passenger.
Install Ruby Packages
Install the required Ruby packages by specifying this repository.
Install RubyGems from Source
We prefer to install RubyGems from source rather than use the OS-provided version (if any), as it is cross platform, so we know what to expect.
For Debian and Ubuntu users, see the Debian Position on RubyGems. If you prefer to install Chef from APT packages, you can use the Opscode APT repository to install Chef on Debian or Ubuntu with APT.
| $PATH Issues If you use an OS-provided RubyGems package instead of installing from source, you may need to add the path where it puts RubyGem-installed programs to your system's PATH, otherwise Chef may not start/work properly. If you're not sure what path to add, check gem env for "EXECUTABLE DIRECTORY". |
Configure Gem Sources
The Opscode Gem releases are available via RubyGems. As of RubyGems 1.3.6, this is the default source and you don't need to do anything. If you're running an older version, the default source is http://gems.rubyforge.org/; it has been changed by the Ruby community to point to rubygems.org for the foreseeable future and you don't need to do anything. However, it is probably a good idea to make sure that your sources are updated:
Install Chef Gem
Now we'll install the Chef RubyGem. This also installs Chef's dependencies.
Set up Chef
Now that you have Chef installed, you're ready to bootstrap Chef.