Installing Chef

By now, Ruby should have installed, and you should see something like:

Install of ruby-1.9.2-p180 - #complete

Congratulations—you have installed Ruby using RVM. Now, remember, henceforth you will be using RVM to manage everything to do with Ruby. If you run ruby --version, you’ll see the current version. Depending on the state of your machine before you installed RVM, this may be the “system” Ruby provided by your distribution/vendor, or it may be nothing at all. I see:

$ ruby --version
The program 'ruby' is currently not installed.  You can install it by typing:
sudo apt-get install ruby

We need to tell RVM we want to use one of the Rubies we’ve installed:

$ rvm use 1.9.2
Using /home/USER/.rvm/gems/ruby-1.9.2-p180
$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

If you see something similar, you’re ready to proceed to the next section. If you haven’t made it this far, check out the RVM troubleshooting page at https://rvm.beginrescueend.com/support/troubleshooting/ or join the #rvm IRC channel at irc.freenode.net.

Chef is distributed as a RubyGem. RVM, in addition to supporting multiple Ruby versions, also provides very convenient gem management functionality. Because of the nature of the Ruby development community, RubyGems tends to evolve rapidly. Various projects sometimes require specific versions of a gem, and before long it becomes very complicated to keep track of what gems are installed for what purpose. RVM introduces the concept of “gemsets.” ...

Get Test-Driven Infrastructure with Chef now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.