rbenv-cinc-workstation
This plugin lets you treat Cinc Workstation as another version in rbenv.
It is a port of docwhat/rbenv-chef-workstation to Cinc Workstation, the community fork of Chef Workstation.
Requirements
- Cinc Workstation installed in
/opt/cinc-workstation
Installation
Clone this repository into the $(rbenv root)/plugins directory:
$ cd $(rbenv root)/plugins
$ git clone <url>
Then create an empty directory in $(rbenv root)/versions called
cinc-workstation:
$ mkdir "$(rbenv root)/versions/cinc-workstation"
Finally, select the new cinc-workstation version and rehash:
$ rbenv shell cinc-workstation
$ rbenv rehash
$ rbenv which ruby
/opt/cinc-workstation/embedded/bin/ruby
For a repository, put cinc-workstation in its .ruby-version file instead of
calling rbenv shell.
That's it!
Troubleshooting
If you are having problems, try running sanity-check.sh:
$ $SHELL "$(rbenv root)/plugins/rbenv-cinc-workstation/sanity-check.sh"
Error running commands and errors talk about chefdk
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"
Hey, what happened to gem?
With Cinc Workstation you have to use cinc gem instead.
Why don't you include /opt/cinc-workstation/embedded/bin?
We don't fully include the /opt/cinc-workstation/embedded/bin directory
because it'll break your system in subtle ways.
/opt/cinc-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 Cinc Workstation so it gets reliable results across platforms.
If we made shims of these commands, your system might break when not using
cinc-workstation and can produce unexpected results even if you were using
cinc-workstation if your version of these commands are different (e.g. Gnu vs.
BSD or version).
Why not just symlink /opt/cinc-workstation/embedded to $(rbenv root)/versions/cinc-workstation?
For the same reason we don't include /opt/cinc-workstation/embedded/bin: It
breaks systems commands in unexpected ways.
Rbenv isn't working or is using gems from the wrong place
Make sure you haven't run cinc shell-init in your shell startup files. rbenv
cannot work if it has already been run.
Specifically, make sure you aren't calling cinc shell-init anywhere in your
shell startup files.
"can't find executable cinc (Gem::Exception)"
This is because you are using
rbenv-bundle-exec.
You'll have to tell rbenv-bundle-exec to ignore binaries that are only in
Cinc Workstation:
echo cinc >> ~/.no_bundle_exec
echo berks >> ~/.no_bundle_exec
License
MIT, see LICENSE.