Search code examples
rubychef-infraknife-solo

If I want to use chef to install software,what shoud I do on the server machine


I learn chef recently, and I find the tutorial on the Internet,they install the ruby environment and chef before they install software on the server machine.

apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
gem install chef ruby-shadow --no-ri --no-rdoc

my question is the ruby environment and gem chef is a requirement if I want to install software on the server machine?


Solution

  • Since Chef 11, Chef is shipped with Omnibus Installer. This brings (almost) everything that Chef needs, including a ruby environment. So you don't have to install any ruby and you are not supposed to install the Chef gem.

    Instead download chef-client and follow the install instructions. Alternatively, you can use this command:

    curl -L https://www.opscode.com/chef/install.sh | sudo bash