Project

General

Profile

Actions

Bug #12070

closed

"wrong argument type nil" when installing any gem with Puppet on Arch Linux

Added by l0b0 (Victor Engmark) about 8 years ago. Updated almost 8 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[ruby-core:73804]

Description

Based on Stack Exchange question:

I've got the following:

class travis_linter {
  include shell

  package { 'travis-lint':
    ensure   => latest,
    provider => gem,
  }
}

When I try to test it, however, I get the following Puppet output:

==> default: Debug: Executing: '/usr/bin/gem install --no-rdoc --no-ri travis-lint'
==> default: Error: Could not update: Execution of '/usr/bin/gem install --no-rdoc --no-ri travis-lint' returned 1: ERROR:  While executing gem ... (TypeError)
==> default:     wrong argument type nil (expected Regexp)
==> default: Error: /Stage[main]/Travis_linter/Package[travis-lint]/ensure: change from absent to latest failed: Could not update: Execution of '/usr/bin/gem install --no-rdoc --no-ri travis-lint' returned 1: ERROR:  While executing gem ... (TypeError)
==> default:     wrong argument type nil (expected Regexp)

Other possibly relevant output from the full log file:

Debug: Puppet::Type::Package::ProviderPuppet_gem: file /opt/puppetlabs/puppet/bin/gem does not exist
Debug: /Package[puppet-lint]: Provider gem does not support features virtual_packages; not managing attribute allow_virtual
Debug: /Package[reek]: Provider gem does not support features virtual_packages; not managing attribute allow_virtual
Debug: /Package[travis-lint]: Provider gem does not support features virtual_packages; not managing attribute allow_virtual

Using exec instead of package results in the same error:

==> default: Debug: Exec[/usr/bin/gem install --no-rdoc --no-ri travis-lint](provider=posix): Executing '/usr/bin/gem install --no-rdoc --no-ri travis-lint'
==> default: Debug: Executing: '/usr/bin/gem install --no-rdoc --no-ri travis-lint'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri travis-lint]/returns: ERROR:  While executing gem ... (TypeError)
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri travis-lint]/returns:     wrong argument type nil (expected Regexp)
==> default: Error: /usr/bin/gem install --no-rdoc --no-ri travis-lint returned 1 instead of one of [0]
==> default: Debug: Class[Travis_linter]: Resource is being skipped, unscheduling all events
==> default: Error: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri travis-lint]/returns: change from notrun to 0 failed: /usr/bin/gem install --no-rdoc --no-ri travis-lint returned 1 instead of one of [0]

I am able to run the exact same command manually:

[vagrant@archlinux ~]$ /usr/bin/gem install --no-rdoc --no-ri travis-lint
Fetching: travis-lint-2.0.0.gem (100%)
WARNING:  You don't have /home/vagrant/.gem/ruby/2.3.0/bin in your PATH,
          gem executables will not run.
Successfully installed travis-lint-2.0.0
1 gem installed

Ditto in a root shell:

[vagrant@archlinux ~]$ sudo -s
root@archlinux:/home/vagrant# /usr/bin/gem install --no-rdoc --no-ri travis-lint
WARNING:  You don't have /root/.gem/ruby/2.3.0/bin in your PATH,
          gem executables will not run.
Successfully installed travis-lint-2.0.0
1 gem installed

And ditto in sh:

[vagrant@archlinux ~]$ sudo sh
sh-4.3# /usr/bin/gem install --no-rdoc --no-ri travis-lint
WARNING:  You don't have /root/.gem/ruby/2.3.0/bin in your PATH,
          gem executables will not run.
Successfully installed travis-lint-2.0.0
1 gem installed

Is something broken about running gem 2.5.1 with Puppet 4.3.1/4.3.2?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0