Skip to content

Prerequisites

jeremiahsnapp edited this page May 22, 2012 · 2 revisions

The following are required to be productive with this Chef repository.


Install VirtualBox

Install Git

sudo apt-get install git

Install Ruby

I prefer to install Ruby on a workstation using rbenv to have an isolated, per user Ruby environment.

rbenv is similar to RVM but is a much simpler and cleaner solution.

rbenv only works on *nix operating systems so if you want to install Ruby on Windows you should use something like RubyInstaller.

Install rbenv

cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc

Restart your shell so the path changes take effect. You can now begin using rbenv.

Install ruby-build.

mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git

Install the following packages for Ruby to link to while being built.

sudo apt-get install zlib1g-dev libreadline-dev libssl-dev

Install a version of Ruby and Ruby Gems.

rbenv install 1.9.3-p125

Rebuild the shim binaries

This should be done any time you install a new Ruby binary (for example, when installing a new Ruby version, or when installing a gem that provides a binary).

rbenv rehash

Set the global version of Ruby.

rbenv global 1.9.3-p125

Install the Ruby Gems

Required

Since you are using rbenv you won't need to use sudo when installing gems.

gem install chef librarian vagrant --no-ri --no-rdoc

Optional - These gems may be helpful when working with Knife and a Chef Server.

Rebuild the rbenv shim binaries.

Binaries were created for chef and librarian tools.

rbenv rehash