test-kitchen / busser-serverspec

A Busser runner plugin for the serverspec testing library
Other
54 stars 41 forks source link

busser-serverspec requires Ruby version >= 2.3.0 #58

Closed atifrasheed79 closed 1 year ago

atifrasheed79 commented 5 years ago

Hello there,

Rubygems site states that the subject gem should work with any Ruby version but on Redhat during "Kitchen exec kitchen test", it's asking for Ruby >= 2.3.0. I have pasted the logs for your kind review, will appreciate any help in this regard. Thanks.

Fetching: busser-0.7.1.gem (100%) Successfully installed busser-0.7.1 2 gems installed -----> Installing Busser plugin: busser-serverspec Plugin serverspec installed (version 0.5.10) -----> Running postinstall for serverspec plugin /usr/share/rubygems/rubygems/installer.rb:518:in ensure_required_ruby_version_met': bundler requires Ruby version >= 2.3.0. (Gem::InstallError) from /usr/share/rubygems/rubygems/installer.rb:781:inpre_install_checks' from /usr/share/rubygems/rubygems/installer.rb:216:in install' from /usr/share/rubygems/rubygems/dependency_installer.rb:374:inblock in install' from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in each' from /usr/share/rubygems/rubygems/dependency_installer.rb:337:ineach_with_index' from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in install' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:44:ininstall_gem' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/helpers.rb:57:in install_gem' from /tmp/verifier/gems/gems/busser-serverspec-0.5.10/lib/busser/runner_plugin/serverspec.rb:28:inblock in ' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:ininvoke_command' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in block in invoke_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:ineach' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in map' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:ininvoke_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in dispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:instart' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/runner_plugin.rb:36:in block in postinstall' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:80:inblock in run_postinstall' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:100:in drop_ssl_verify_peer' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:80:inrun_postinstall' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:57:in install' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:inblock (2 levels) in install_all' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:in each' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:43:inblock in install_all' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/rubygems.rb:71:in silence_gem_ui' from /tmp/verifier/gems/gems/busser-0.7.1/lib/busser/command/plugin_install.rb:42:ininstall_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:ininvoke_command' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in block in invoke_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:ineach' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in map' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:ininvoke_all' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in dispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:ininvoke' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:40:in block in register' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:inrun' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in invoke_command' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:indispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in invoke' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:235:inblock in subcommand' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in run' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:ininvoke_command' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor.rb:359:in dispatch' from /tmp/verifier/gems/gems/thor-0.19.0/lib/thor/base.rb:440:instart' from /tmp/verifier/gems/gems/busser-0.7.1/bin/busser:8:in <top (required)>' from /tmp/verifier/bin/busser:23:inload' from /tmp/verifier/bin/busser:23:in `

'

------Exception------- Class: Kitchen::ActionFailed Message: 1 actions failed. Verify failed on instance . Please see .kitchen/logs/default-codeninjas-rhel-7-java-18.log for more details

Please see .kitchen/logs/kitchen.log for more details Also try running kitchen diagnose --all for configuration

tanob commented 5 years ago

Got the same issue, looks like it's because this gem installs bundler without a version specifier: https://github.com/test-kitchen/busser-serverspec/blob/f8047acb136683e3d4098ada2d379e4d9e5922f5/lib/busser/runner_plugin/serverspec.rb#L28

and Bundler v2 requires Ruby >= 2.3.0: https://rubygems.org/gems/bundler/versions/2.0.0

atifrasheed79 commented 5 years ago

Thanks @tanob for your analysis. I think you got it right but how you fixed this? because I tried to restrict bundler to 1.17.x in the Gemfile but it's not working. Appreciate your help.

atifrasheed79 commented 5 years ago

I have also tried to install the problematic gems via bootstrap.sh and I can see they are installed in the "kitchen converge" phase but kitchen still tries to install them during "kitchen verify", not sure why!

All I want is to restrict kitchen-test to use bundler 1.17.3, and I might be missing something somewhere, but both recipe Gemfile and this bootstrap option isn't working for me.

tanob commented 5 years ago

I think this is a duplicate of issue https://github.com/test-kitchen/busser-serverspec/issues/55

atifrasheed79 commented 5 years ago

Yeah, I was able to work it around by setting the BUSSER_HOME, GEM_HOME, GEM_PATH etc. in UserData (kitchen.yml) for the EC2 instance Kitchen will launch, and bootstrap.sh.

When I enabled debug, I found that Kitchen converge and setup are working in different environment when I was doing "Kitchen test", so I just made sure both steps refer to same GEM environment.

chuhn commented 1 year ago

This problem now extends to Ruby >= 2.6.0 as Bundler 2.4 dropped support for older Rubys. This affects eg. Debian 10.

Can this be fixed?

chuhn commented 1 year ago

This fork pins bundler and restores compatibility with older Ruby versions: https://github.com/clemblanco/busser-serverspec_chefdk30

Works for me.