Open pmyjavec opened 6 years ago
Yeah, it seems that on CentOS 7 the ruby package depends on rubygems, so installing ruby also installs rubygems, however that's not true in CentOS 6...
# cat /etc/system-release
CentOS Linux release 7.4.1708 (Core)
$ rpm -q --requires ruby | grep rubygems
ruby(rubygems) >= 2.0.14.1
so installing ruby will pull in the gems package...
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ]; then
sudo -E -H yum -y install ruby
However on CentOS 6, this is not the case, and ruby doesn't depend on rubygems;
# rpm -qR ruby
/usr/bin/ruby
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libcrypt.so.1()(64bit)
libdl.so.2()(64bit)
libm.so.6()(64bit)
libpthread.so.0()(64bit)
librt.so.1()(64bit)
libruby.so.1.8()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
ruby-libs = 1.8.7.374-5.el6
rpmlib(PayloadIsXz) <= 5.2-1
# cat /etc/system-release
CentOS release 6.9 (Final)
so installing it doesn't get gems in the path. So the script jumps to trying to trying to install bundler with gem
and fails;
if [ "$(sudo -E -H gem list bundler -i)" = "true" ]; then
This fixes it for CentOS, and I've tested it against CentOS7, and fedora-27
diff --git a/lib/kitchen/verifier/serverspec.rb b/lib/kitchen/verifier/serverspec.rb
index 4304d58..0932e73 100644
--- a/lib/kitchen/verifier/serverspec.rb
+++ b/lib/kitchen/verifier/serverspec.rb
@@ -134,7 +134,7 @@ module Kitchen
if [ ! $(which ruby) ]; then
echo '-----> Installing ruby, will try to determine platform os'
if [ -f /etc/centos-release ] || [ -f /etc/redhat-release ] || [ -f /etc/oracle-release ]; then
- #{sudo_env('yum')} -y install ruby
+ #{sudo_env('yum')} -y install ruby rubygems
else
if [ -f /etc/system-release ] && grep -q 'Amazon Linux' /etc/system-release; then
#{sudo_env('yum')} -y install ruby
When testing against CentOS 6 hosts, it seems the
rubygems
package is not installed which then causes the "verify" step to fail.To resolve the issue I just logged into the box manually and installed
rubygems
See the output: