Use Chef Workstation's ruby with rbenv #324

Merged
greg merged 4 commits from chore/remove_bundler_version_lock into master 2021-06-15 20:26:23 +00:00
Owner

The proper way to install Chef, knife, etc. these days is with Chef Workstation.

This adds a local rbenv config for using the bundled workstation ruby in the Chef repo by default. There's a rbenv plugin for this: rbenv-chef-workstation

It also removes the strict bundler version requirement in Gemfile.lock, so you can use both newer and older versions of bundler if you want/need.

The proper way to install Chef, knife, etc. these days is with [Chef Workstation](https://docs.chef.io/workstation/). This adds a local rbenv config for using the bundled workstation ruby in the Chef repo by default. There's a rbenv plugin for this: [rbenv-chef-workstation](https://github.com/docwhat/rbenv-chef-workstation) It also removes the strict bundler version requirement in `Gemfile.lock`, so you can use both newer and older versions of bundler if you want/need.
raucao added the
enhancement
kredits-1
labels 2021-05-28 12:46:21 +00:00
raucao added 2 commits 2021-05-28 12:46:21 +00:00
raucao added 1 commit 2021-05-28 12:51:58 +00:00
bda100313e
Update README
Add some info about Chef Workstation and rbenv.
raucao requested review from greg 2021-05-30 17:34:49 +00:00
Author
Owner

@greg Want to have a quick look at this?

@greg Want to have a quick look at this?
Owner

@greg Want to have a quick look at this?

Sure, I will after the call

> @greg Want to have a quick look at this? Sure, I will after the call
Owner

The changes look good to me but I'm using chruby so I need to find a way to make knife plugins work, with the new setup things like knife-zero don't work when I'm running knife from Chef Workstation. I'll take a closer look tomorrow

The changes look good to me but I'm using [chruby](https://github.com/postmodern/chruby) so I need to find a way to make knife plugins work, with the new setup things like knife-zero don't work when I'm running knife from Chef Workstation. I'll take a closer look tomorrow
Owner

I think our Gemfile should only contain knife-zero if we use Chef Workstation (everything else is already part of it)

chruby's definitely not playing nice with Chef Workstation, even installing a gem directly with /opt/chef-workstation/embedded/bin/gem install knife-zero ends up with the gem not being installed in the right path. I think I will end up switching to rbenv to work around this issue, because chruby doesn't appear to have a plugin system, and rbenv-chef-workstation's README mentions a bunch of PATH issues that breaks things in subtle ways.

I think our `Gemfile` should only contain `knife-zero` if we use Chef Workstation (everything else is already part of it) chruby's definitely not playing nice with Chef Workstation, even installing a gem directly with `/opt/chef-workstation/embedded/bin/gem install knife-zero` ends up with the gem not being installed in the right path. I think I will end up switching to rbenv to work around this issue, because chruby doesn't appear to have a plugin system, and [rbenv-chef-workstation's README](https://github.com/docwhat/rbenv-chef-workstation) mentions a bunch of PATH issues that breaks things in subtle ways.
Owner

@raucao I forgot to ask, did you check that knife-zero works for you with this setup?

@raucao I forgot to ask, did you check that `knife-zero` works for you with this setup?
Author
Owner

@raucao I forgot to ask, did you check that knife-zero works for you with this setup?

Yes, of course.

> @raucao I forgot to ask, did you check that knife-zero works for you with this setup? Yes, of course.
Author
Owner

I have a new PR for the RSK cookbook incoming, but it's based on this branch. Would be great if we can merge it soon...

I have a new PR for the RSK cookbook incoming, but it's based on this branch. Would be great if we can merge it soon...
greg added 1 commit 2021-06-15 20:21:44 +00:00
9a3565c11f Only keep the knife-zero gem in the Gemfile
The rest is already shipped with Chef Workstation
greg approved these changes 2021-06-15 20:26:12 +00:00
greg left a comment
Owner

👍

👍
greg merged commit 5bc4266857 into master 2021-06-15 20:26:23 +00:00
greg deleted branch chore/remove_bundler_version_lock 2021-06-15 20:26:30 +00:00
Author
Owner

@greg Just for future use: when you add commits to a PR, especially when it's a kredits-1, you can add yourself to the assigned-people list, so you also get a full small contrib kredited.

@greg Just for future use: when you add commits to a PR, especially when it's a `kredits-1`, you can add yourself to the assigned-people list, so you also get a full small contrib kredited.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kosmos/chef#324
No description provided.