busser-serverspec icon indicating copy to clipboard operation
busser-serverspec copied to clipboard

busser-serverspec requires Ruby version >= 2.3.0

Open atifrasheed79 opened this issue 6 years ago • 5 comments

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:in pre_install_checks' from /usr/share/rubygems/rubygems/installer.rb:216:in install' from /usr/share/rubygems/rubygems/dependency_installer.rb:374:in block in install' from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in each' from /usr/share/rubygems/rubygems/dependency_installer.rb:337:in each_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:in install_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:in block in class:Serverspec' 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:in invoke_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:in each' 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:in invoke_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:in start' 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:in block 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:in run_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:in block (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:in block 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:in install_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:in invoke_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:in each' 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:in invoke_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:in invoke' 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:in run' 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:in dispatch' 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:in block 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:in invoke_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:in start' from /tmp/verifier/gems/gems/busser-0.7.1/bin/busser:8:in <top (required)>' from /tmp/verifier/bin/busser:23:in load' 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

atifrasheed79 avatar Jan 16 '19 04:01 atifrasheed79

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

tanob avatar Jan 18 '19 19:01 tanob

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 avatar Jan 21 '19 00:01 atifrasheed79

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.

atifrasheed79 avatar Jan 21 '19 05:01 atifrasheed79

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

tanob avatar Jan 31 '19 00:01 tanob

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.

atifrasheed79 avatar Feb 05 '19 00:02 atifrasheed79

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 avatar Jan 17 '23 13:01 chuhn

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

Works for me.

chuhn avatar Jan 17 '23 13:01 chuhn