나는 가지고있다다음과 같은:
class travis_linter {
include shell
package { 'travis-lint':
ensure => latest,
provider => gem,
}
}
내가 시도할 때시험을 받다그러나 다음과 같은 Puppet 출력이 나타납니다.
==> 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)
관련될 수 있는 기타 출력전체 로그 파일:
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
대신 exec
(with --backtrace
및 )를 사용하면 동일한 오류가 발생합니다.--debug
package
==> default: Debug: Executing: '/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: NOTE: Debugging mode prints all exceptions even when rescued
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: Exception `ArgumentError' at /usr/lib/ruby/2.3.0/rubygems.rb:498 - couldn't find HOME environment -- expanding `~'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: Exception `LoadError' at /usr/lib/ruby/2.3.0/resolv.rb:171 - LoadError
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: Exception `Resolv::DNS::Config::NXDomain' at /usr/lib/ruby/2.3.0/resolv.rb:549 - _rubygems._tcp.api.rubygems.org
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: Exception `Resolv::DNS::Config::NXDomain' at /usr/lib/ruby/2.3.0/resolv.rb:549 - _rubygems._tcp.api.rubygems.org.vagrant.vm
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: Exception `Resolv::ResolvError' at /usr/lib/ruby/2.3.0/resolv.rb:494 - DNS result has no information for _rubygems._tcp.api.rubygems.org
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: Exception `TypeError' at /usr/lib/ruby/2.3.0/rubygems/installer.rb:674 - wrong argument type nil (expected Regexp)
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: ERROR: While executing gem ... (TypeError)
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: wrong argument type nil (expected Regexp)
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/installer.rb:674:in `sub'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/installer.rb:674:in `check_that_user_bin_dir_is_in_path'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/installer.rb:180:in `initialize'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/installer.rb:104:in `new'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/installer.rb:104:in `at'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/request_set.rb:163:in `block in install'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/request_set.rb:151:in `each'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/request_set.rb:151:in `install'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/commands/install_command.rb:250:in `install_gem'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/commands/install_command.rb:300:in `block in install_gems'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/commands/install_command.rb:296:in `each'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/commands/install_command.rb:296:in `install_gems'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/commands/install_command.rb:203:in `execute'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/command.rb:308:in `invoke_with_build_args'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/command_manager.rb:169:in `process_args'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/command_manager.rb:139:in `run'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/lib/ruby/2.3.0/rubygems/gem_runner.rb:55:in `run'
==> default: Notice: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: /usr/bin/gem:21:in `<main>'
==> default: Error: /usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Travis_linter/Exec[/usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint]/returns: change from notrun to 0 failed: /usr/bin/gem install --no-rdoc --no-ri --backtrace --debug travis-lint returned 1 instead of one of [0]
동일한 명령을 수동으로 실행할 수 있습니다.
[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
같은 상기와루트 쉘에서:
[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
같은 상기와 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
달리는데 별 문제 없나요?gem
2.5.1그리고퍼핏 4.3.1/4.3.2?
지난 몇발견하다! 것 같다gem install
HOME
변수가 정의되지 않은 환경에서실패할 것이다:
unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV['HOME'], '~'))
추악한 해결 방법:
exec { '/usr/bin/gem install --no-rdoc --no-ri travis-lint':
environment => 'HOME=/root';
}