This plugin lets you treat Chef Workstation as another version in rbenv.
Chef Workstation replaces ChefDK. If you want to use ChefDK instead, then use the old rbenv-chefdk plugin instead.
- Chef Workstation installed in
/opt/chef-workstation
To install rbenv-chef-workstation, clone this repository into the $(rbenv root)/plugins
directory.
$ cd $(rbenv root)/plugins
$ git clone <url>
Warning: If you've previously installed Chef Workstation, you will want to undo the changes recommended in the Chef Workstation install instructions or in the Homebrew info gist. Otherwise rbenv
or Chef Workstation will not work correctly.
Then create an empty directory in $(rbenv root)/versions
called chef-workstation
:
$ mkdir "$(rbenv root)/versions/chef-workstation"
Finally, change to the new chef-workstation
version and run rbenv rehash
.
$ rbenv shell chef-workstation
$ rbenv rehash
$ rbenv which ruby
/opt/chef-workstation/embedded/bin/ruby
That's it!
If you are having problems, try running sanity-check.sh
:
$ $SHELL "$(rbenv root)/plugins/rbenv-chef-workstation/sanity-check.sh"
Make sure you have completely uninstalled chefdk:
# This removes old Gems and the rbenv-chefdk plugin.
$ rm -rf ~/.chefdk "$(rbenv root)/plugins/rbenv-chefdk" "$(rbenv root)/versions/chefdk"
With the Chef Workstation you have to use chef gem
instead.
We don't fully include the /opt/chef-workstation/embedded/bin
directory because it'll break your system in subtle ways.
/opt/chef-workstation/embedded/bin
has commands like clear
, tput
, xsltproc
, and xz
. These are commands that are part of your system and are only included in Chef Workstation so it gets reliable results across platforms.
If we made shims of these commands, your system might break when not using chef-workstation and can produce unexpected results even if you were using chef-workstation if your version of these commands are different (e.g. Gnu vs. BSD or version).
For the same reason we don't include /opt/chef-workstation/embedded/bin
: It breaks systems commands in unexpected ways.
Make sure you undid any changes recommended by the Chef Workstation install instructions or in the Homebrew info gist.
Specifically, make sure you aren't calling chef shell-init
anyplace in your shell startup files.
This is because you are using rbenv-bundle-exec
.
You'll have to tell rbenv-bundle-exec
to ignore a bunch of binaries that are only in Chef Workstation:
echo chef >> ~/.no_bundle_exec
echo berks >> ~/.no_bundle_exec
You can reach me at docwhat.org or as docwhat on Freenode IRC.
See the LICENSE
file
- 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.
- Commit
- Send me a pull request. Bonus points for topic branches.