newcontext-oss / kitchen-terraform

Test Kitchen plugins for testing Terraform configurations
https://github.com/newcontext/kitchen-terraform
Apache License 2.0
1.13k stars 145 forks source link

Getting Could not load the 'terraform' driver. Error: uninitialized constant Dry::Container::DidYouMean #471

Closed ssurendra549 closed 1 week ago

ssurendra549 commented 2 years ago

Getting Could not load the 'terraform' driver. Error: uninitialized constant Dry::Container::DidYouMean error when giving "kitchen test" command.

I am using Kitchen-terrafrom version - 6.1.0

Below are the logs

I, [2022-07-25T10:22:02.446335 #2076] INFO -- Kitchen: -----> Starting Test Kitchen (v3.2.2) E, [2022-07-25T10:22:02.640648 #2076] ERROR -- Kitchen: ------Exception------- E, [2022-07-25T10:22:02.640701 #2076] ERROR -- Kitchen: Class: Kitchen::ClientError E, [2022-07-25T10:22:02.640719 #2076] ERROR -- Kitchen: Message: Could not load the 'terraform' driver. Error: uninitialized constant Dry::Container::DidYouMean E, [2022-07-25T10:22:02.640733 #2076] ERROR -- Kitchen: ---------------------- E, [2022-07-25T10:22:02.640747 #2076] ERROR -- Kitchen: ------Backtrace------- E, [2022-07-25T10:22:02.640757 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/plugin.rb:45:in rescue in load' E, [2022-07-25T10:22:02.640770 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/plugin.rb:33:inload' E, [2022-07-25T10:22:02.640780 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/driver.rb:37:in for_plugin' E, [2022-07-25T10:22:02.640789 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:235:innew_driver' E, [2022-07-25T10:22:02.640797 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:250:in new_instance' E, [2022-07-25T10:22:02.640806 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:143:inblock in build_instances' E, [2022-07-25T10:22:02.640815 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:142:in map' E, [2022-07-25T10:22:02.640829 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:142:inwith_index' E, [2022-07-25T10:22:02.640844 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:142:in build_instances' E, [2022-07-25T10:22:02.640858 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:116:ininstances' E, [2022-07-25T10:22:02.640872 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command.rb:109:in filtered_instances' E, [2022-07-25T10:22:02.640887 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command.rb:139:inparse_subcommand' E, [2022-07-25T10:22:02.640900 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command/test.rb:39:in block in call' E, [2022-07-25T10:22:02.640913 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/3.0.0/benchmark.rb:293:inmeasure' E, [2022-07-25T10:22:02.640927 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command/test.rb:37:in call' E, [2022-07-25T10:22:02.640940 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/cli.rb:52:inperform' E, [2022-07-25T10:22:02.640955 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/cli.rb:250:in test' E, [2022-07-25T10:22:02.640969 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:inrun' E, [2022-07-25T10:22:02.640982 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command' E, [2022-07-25T10:22:02.640996 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:indispatch' E, [2022-07-25T10:22:02.641010 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in start' E, [2022-07-25T10:22:02.641030 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/bin/kitchen:11:inblock in <top (required)>' E, [2022-07-25T10:22:02.641043 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/errors.rb:183:in with_friendly_errors' E, [2022-07-25T10:22:02.641052 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/bin/kitchen:11:in<top (required)>' E, [2022-07-25T10:22:02.641060 #2076] ERROR -- Kitchen: /opt/chef-workstation/bin/kitchen:383:in load' E, [2022-07-25T10:22:02.641068 #2076] ERROR -- Kitchen: /opt/chef-workstation/bin/kitchen:383:in

' E, [2022-07-25T10:22:02.641076 #2076] ERROR -- Kitchen: ----End Backtrace----- E, [2022-07-25T10:22:02.641084 #2076] ERROR -- Kitchen: ---Nested Exception--- E, [2022-07-25T10:22:02.641092 #2076] ERROR -- Kitchen: Class: NameError E, [2022-07-25T10:22:02.641100 #2076] ERROR -- Kitchen: Message: uninitialized constant Dry::Container::DidYouMean E, [2022-07-25T10:22:02.641109 #2076] ERROR -- Kitchen: ---------------------- E, [2022-07-25T10:22:02.641120 #2076] ERROR -- Kitchen: ------Backtrace------- E, [2022-07-25T10:22:02.641129 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/plugin.rb:45:in rescue in load' E, [2022-07-25T10:22:02.641138 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/plugin.rb:33:inload' E, [2022-07-25T10:22:02.641150 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/driver.rb:37:in for_plugin' E, [2022-07-25T10:22:02.641159 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:235:innew_driver' E, [2022-07-25T10:22:02.641167 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:250:in new_instance' E, [2022-07-25T10:22:02.641176 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:143:inblock in build_instances' E, [2022-07-25T10:22:02.641185 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:142:in map' E, [2022-07-25T10:22:02.641194 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:142:inwith_index' E, [2022-07-25T10:22:02.641207 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:142:in build_instances' E, [2022-07-25T10:22:02.641217 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/config.rb:116:ininstances' E, [2022-07-25T10:22:02.641229 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command.rb:109:in filtered_instances' E, [2022-07-25T10:22:02.641237 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command.rb:139:inparse_subcommand' E, [2022-07-25T10:22:02.641245 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command/test.rb:39:in block in call' E, [2022-07-25T10:22:02.641253 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/3.0.0/benchmark.rb:293:inmeasure' E, [2022-07-25T10:22:02.641261 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/command/test.rb:37:in call' E, [2022-07-25T10:22:02.641269 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/cli.rb:52:inperform' E, [2022-07-25T10:22:02.641291 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/cli.rb:250:in test' E, [2022-07-25T10:22:02.641303 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:inrun' E, [2022-07-25T10:22:02.641312 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command' E, [2022-07-25T10:22:02.641324 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:indispatch' E, [2022-07-25T10:22:02.641333 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in start' E, [2022-07-25T10:22:02.641343 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/bin/kitchen:11:inblock in <top (required)>' E, [2022-07-25T10:22:02.641353 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/lib/kitchen/errors.rb:183:in with_friendly_errors' E, [2022-07-25T10:22:02.641361 #2076] ERROR -- Kitchen: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/test-kitchen-3.2.2/bin/kitchen:11:in<top (required)>' E, [2022-07-25T10:22:02.641372 #2076] ERROR -- Kitchen: /opt/chef-workstation/bin/kitchen:383:in load' E, [2022-07-25T10:22:02.641381 #2076] ERROR -- Kitchen: /opt/chef-workstation/bin/kitchen:383:in
' E, [2022-07-25T10:22:02.641393 #2076] ERROR -- Kitchen: ----End Backtrace-----

aaron-lane commented 2 years ago

Hi @ssurendra549! Thank you for your interest in the project. I'm sorry that you're having a frustrating experience.

Can you please share the command that you are using to invoke Kitchen-Terraform?

ssurendra549 commented 2 years ago

Hi @aaron-lane , Thanks for your response.I am using "kitchen test" command to run the tests and I am using "gem install kitchen- terraform" command to install.

Previously everything used to work fine but from past one week it's throwing the above mentioned error...I am expecting it is something issue with the dry-container version ....

aaron-lane commented 2 years ago

Thank you for confirming that! Please use Bundler to install and execute the gem, as described in the README; any other method may result in dependency issues that we can not help to resolve.

ssurendra549 commented 2 years ago

Getting the below issue while trying to install using Bundler, Please suggest how to fix it.

An error occurred while installing unf_ext (0.0.8.2), and Bundler cannot make g++: Command not found make: *** [Makefile:213: unf.o] Error 127

aaron-lane commented 2 years ago

Based on that output, it appears that you are missing a required tool to install the unf_ext gem:

2571make: g++: Command not found

elijah commented 2 years ago

The error messages say pretty clearly that you’re missing required developer tools - g++.Sent from my iPhoneOn Jul 29, 2022, at 11:24 AM, ssurendra549 @.> wrote: Getting the below issue while trying to install using Bundler, Please suggest how to fix it. An error occurred while installing unf_ext (0.0.8.2), and Bundler cannot 2549continue. 2550In Gemfile: 2551 kitchen-terraform was resolved to 6.1.0, which depends on 2552 inspec was resolved to 4.56.20, which depends on 2553 train was resolved to 3.10.1, which depends on 2554 azure_graph_rbac was resolved to 0.17.2, which depends on 2555 ms_rest_azure was resolved to 0.12.0, which depends on 2556 faraday-cookie_jar was resolved to 0.0.7, which depends on 2557 http-cookie was resolved to 1.0.5, which depends on 2558 domain_name was resolved to 0.5.20190701, which depends on 2559 unf was resolved to 0.1.4, which depends on 2560 unf_ext 2561Bundler::InstallError: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 2562 current directory: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2/ext/unf_ext 2563/opt/chef-workstation/embedded/bin/ruby -I /opt/chef-workstation/embedded/lib/ruby/3.0.0 -r ./siteconf20220729-38-jpnwdc.rb extconf.rb 2564checking for -lstdc++... no 2565creating Makefile 2566current directory: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2/ext/unf_ext 2567make DESTDIR= clean 2568current directory: /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2/ext/unf_ext 2569make DESTDIR= 2570compiling unf.cc 2571make: g++: Command not found 2572make: [Makefile:213: unf.o] Error 127 2573make failed, exit code 2 2574Gem files will remain installed in /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2 for inspection. 2575Results logged to /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/unf_ext-0.0.8.2/gem_make.out 2576 /opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:93:in run' 2577 /opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:44:in block in make' 2578 /opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:36:in each' 2579 /opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:36:in make' 2580 /opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:63:in `block in build'

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>