Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5645

Can't install gems on Arch Linux

    XMLWordPrintable

    Details

    • Template:
    • Team:
      Platform OS
    • Story Points:
      1
    • Sprint:
      Platform OS 2017-08-09, Platform OS 2017-08-22
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The gem provider now passes along the HOME environment variable
    • QA Risk Assessment:
      No Action

      Description

      Update: This might be a gem issue rather than a Puppet issue. Keeping this open since it's not clear yet what the issue is, and since I can only reproduce when the gem command is run with Puppet.

      From unix.stackexchange.com post:

      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
      

      Setting `ensure` to `2.0.0` didn't help, so it's not related to the `latest` keyword:

      Error: Could not update: Execution of '/usr/bin/gem install -v 2.0.0 --no-rdoc --no-ri travis-lint' returned 1: ERROR:  While executing gem ... (TypeError)
          wrong argument type nil (expected Regexp)
      

      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
      

      Is my Puppet manifest wrong, or is something broken about Puppet/Gem? Is it possible that `latest` is not a valid value for gems?

      It works fine on Travis CI (Ubuntu 12.04):

      Debug: Executing: '/home/travis/.rvm/rubies/ruby-2.2.3/bin/gem list --local ^travis-lint$'
      Debug: Executing: '/home/travis/.rvm/rubies/ruby-2.2.3/bin/gem install --no-rdoc --no-ri travis-lint'
      Notice: /Stage[main]/Travis_linter/Package[travis-lint]/ensure: created
      Debug: /Package[travis-lint]: The container Class[Travis_linter] will propagate my refresh event
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              branan Branan Riley
              Reporter:
              l0b0 Victor Engmark
              QA Contact:
              Eric Thompson
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support