How Do You Configure Ruby to Work Properly with the Chef Development Kit on Ubuntu 16.04?

Problem scenario
You are running Ubuntu 16.04 Linux.  You tried to follow the directions for installing the Chef development kit on these two sites: GitHub and Chef.io.  But they do not work.  What should you do?

Solution
Follow these steps:

1.  Change directories to the home directory (e.g., /home/ubuntu or /root/) of the user are logged in as. 
2.  vi .bashrc
3.  Append this line: 
eval "$(chef shell-init bash)"

4.  Save the changes.
5.  Log off as the current user.
6.  Log back in.  Now Ruby should be configured properly for Chef to work.

The GitHub link used to be this one (but as of 4/8/20 it no longer works): https://github.com/chef/chef-web-docs/blob/master/chef_master/source/install_dk.rst

Leave a comment

Your email address will not be published.