我已经为乘客配置了木偶(使用 -https://docs.puppet.com/guides/passenger.html和http://www.olindata.com/blog/2014/09/setup-puppet-master-passenger-and-apache-centos)。
[root@a-puppet-03 ~]# puppet --version
4.4.2
[root@a-puppet-03 ~]# ruby --version
ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]
[root@a-puppet-03 ~]# passenger --version
Phusion Passenger 5.0.28
[root@a-puppet-03 ~]# cat /etc/centos-release
CentOS release 6.7 (Final)
直到最后一步一切都很顺利,当运行 puppet 代理时,出现很多错误。主要是 LoadError。
> puppet agent -t
.
..
[ 2016-05-18 04:06:41.8270 19959/7f95efba2700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-100] Cannot checkout session because a spawning error occurred. The identifier of the error is ba45fc42. Please see earlier logs for details about the error.
App 25759 stdout:
App 25759 stdout:
[ 2016-05-18 04:06:42.2164 19959/7f95ee7a0700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/puppet/rack/puppetmasterd: An error occurred while starting up the preloader.
Error ID: d1069d73
Error details saved to: /tmp/passenger-error-SqIO1Z.html
Message from application: cannot load such file -- puppet/util/command_line (LoadError)
/usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
**config.ru:41:in `block in <main>'**
/usr/local/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/local/lib/ruby/gems/2.1.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:110:in `eval'
/usr/local/lib/ruby/gems/2.1.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
/usr/local/lib/ruby/gems/2.1.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/local/lib/ruby/gems/2.1.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/local/lib/ruby/gems/2.1.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:29:in `<main>'
请有人帮忙吗?提前谢谢了。
答案1
使用irb
命令,输入后$LOAD_PATH
检查你的加载路径,似乎你有版本问题,例如你的puppet版本和ruby版本不兼容
# irb
irb(main):001:0> $LOAD_PATH
=> ["/usr/local/share/ruby/site_ruby", "/usr/local/lib64/ruby/site_ruby", "/usr/share/ruby/vendor_ruby", "/usr/lib64/ruby/vendor_ruby", "/usr/share/rubygems", "/usr/share/ruby", "/usr/lib64/ruby/"]
并确保您可以puppet/util/command_line
在上述路径位置找到。
# find / | grep "puppet/util/command_line"
如果结果find
未包含在路径中,那么您可以
手动添加puppet/util/命令行到 $LOAD_PATH;
或者安装另一个版本的 ruby 或 puppet。