rbenv-chefdk: Use ChefDK with rbenv
- ChefDK installed in
To install rbenv-chefdk, clone this repository into the
cd $(rbenv root)/plugins git clone <url>
On macOS, you can use
brew to install:
brew install rbenv-chefdk
Warning: If you've previously installed ChefDK which led you to using this
plugin, you will want to remove the profile changes recommended in the ChefDK
install instructions or
in the Homebrew info gist. Otherwise
rbenv or ChefDK will not work correctly.
Then create an empty directory in
$(rbenv root)/versions called
$ mkdir "$(rbenv root)/versions/chefdk"
Finally, change to the new
chefdk version and run
$ rbenv shell chefdk $ rbenv rehash $ rbenv which ruby /opt/chefdk/embedded/bin/ruby
If you are having problems, try running
$ $SHELL "$(rbenv root)/plugins/rbenv-chefdk/sanity-check.sh"
Frequently Asked Questions
Hey, what happened to
With the ChefDK you have to use
chef gem instead.
Why don't you include
We don't fully include the
/opt/chefdk/embedded/bin directory because it'll
break your system in subtle ways.
/opt/chefdk/embedded/bin has commands like
xz. These are commands that are part of your system and are only included in
ChefDK so it gets reliable results across platforms.
If we made shims of these commands, your system might break when not using chefdk and can produce unexpected results even if you were using chefdk if your version of these commands are different (e.g. Gnu vs. BSD or version).
Why not just symlink
For the same reason we don't include
/opt/chefdk/embedded/bin: It breaks
systems commands in unexpected ways.
Rbenv isn't working or is using gems from the wrong place
Make sure you undid any changes recommended by the ChefDK install instructions or in the Homebrew info gist.
Specifically, make sure you aren't calling
chef shell-init anyplace in your
shell startup files.
"can't find executable chef (Gem::Exception)"
This is probably because you are using
You'll have to tell
rbenv-bundle-exec to ignore a bunch of binaries that are
only in ChefDK:
echo chef >> ~/.no_bundle_exec echo berks >> ~/.no_bundle_exec
Copyright (c) 2015,2016 Christian Höltje - Released under the MIT License (see
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Send me a pull request. Bonus points for topic branches.