You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using test-kitchen with rvm, it is an old version of chef, and therefore I'm using ruby 2, and the chef workstation works with its own isolated installation of ruby 3.
When I run any chef command, it runs fine:
chef update /Users/rod/my_project/chef/cookbooks/my_cookbook/Policyfile.rb
But then, whenever I run kitchen converge with rvm, it breaks with an error saying that a gem cannot be found. The reason it breaks, is that the environment variable RUBYOPT is sent to Mixlib::ShellOut, and chef-cli, when receives this environment variable, cannot find the right gem path.
Version
3.5.0
Environment
MacBook M1
ruby 2.73 installed from RVM
custom gemset
Chef workstation 22.10.1013
Scenario
Trying to test the cookbooks with kitchen and docker.
Run kitchen with cd my_cookbook && bundle exec kitchen converge
Expected Result
Command should run without error
Actual Result
-----> Starting Test Kitchen (v3.5.0)
-----> Converging <default-centos-71>...
Preparing files for transfer
Policy lock file doesn't exist, running `/usr/local/bin/chef-cli install` for Policyfile /Users/rod/a/b/kitchen-issue/my_cookbook/Policyfile.rb...
/Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/spec_set.rb:86:in `block in materialize': Could not find racc-1.6.1 in any of the sources (Bundler::GemNotFound)
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/spec_set.rb:80:in `map!'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/spec_set.rb:80:in `materialize'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/definition.rb:170:in `specs'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/definition.rb:237:in `specs_for'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/definition.rb:226:in `requested_specs'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/runtime.rb:101:in `block in definition_method'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/runtime.rb:20:in `setup'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler.rb:149:in `setup'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
from /usr/local/bin/chef-cli:in `require'
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #converge action: [Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/chef-cli install /Users/rod/a/b/kitchen-issue/my_cookbook/Policyfile.rb --chef-license accept-no-persist ----
STDOUT:
STDERR: /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/spec_set.rb:86:in `block in materialize': Could not find racc-1.6.1 in any of the sources (Bundler::GemNotFound)
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/spec_set.rb:80:in `map!'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/spec_set.rb:80:in `materialize'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/definition.rb:170:in `specs'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/definition.rb:237:in `specs_for'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/definition.rb:226:in `requested_specs'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/runtime.rb:101:in `block in definition_method'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/runtime.rb:20:in `setup'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler.rb:149:in `setup'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
from /Users/rod/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
from /usr/local/bin/chef-cli:in `require'
---- End output of /usr/local/bin/chef-cli install /Users/rod/a/b/kitchen-issue/my_cookbook/Policyfile.rb --chef-license accept-no-persist ----
Ran /usr/local/bin/chef-cli install /Users/rod/a/b/kitchen-issue/my_cookbook/Policyfile.rb --chef-license accept-no-persist returned 1] on default-centos-71
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
👻 Brief Description
I'm using test-kitchen with rvm, it is an old version of chef, and therefore I'm using ruby 2, and the chef workstation works with its own isolated installation of ruby 3.
When I run any chef command, it runs fine:
But then, whenever I run kitchen converge with rvm, it breaks with an error saying that a gem cannot be found. The reason it breaks, is that the environment variable
RUBYOPT
is sent to Mixlib::ShellOut, and chef-cli, when receives this environment variable, cannot find the right gem path.Version
3.5.0
Environment
Scenario
Trying to test the cookbooks with kitchen and docker.
Steps to Reproduce
rvm install ruby --version 2.7.3
chef install --cask chef-workstation
git clone git@github.com:rorra/kitchen-issue.git
cd kitchen-issue && bundle
cd my_cookbook && bundle exec kitchen converge
Expected Result
Command should run without error
Actual Result
➕ Additional context
Output of
kitchen-diagnose --all
Hack
From the bundle file, edit
lib/kitchen/shell_out.rb
after
add
and now it works fine
The text was updated successfully, but these errors were encountered: