我正在尝试让 puppet 与 augeas 一起工作,但它抱怨没有 augeas 提供商。一些谷歌搜索建议
sudo yum install augeas
augtool ls /files/etc/php.ini # test it works as expected
sudo yum install ruby-augeas # this is to "bridge" ruby and augeas
ruby -raugeas -e "puts Augeas.open" # Test ruby can talk to augeas
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- augeas (LoadError)
from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
除了最后一行之外,一切都正常并且安装成功。Ruby 只是不知道在哪里可以找到 augeas.rb,因为它不在 ruby 包含路径中
[vagrant@SubscriptionsAPI ~]$ sudo find / -name "augeas.rb"
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/puppet-3.4.3/lib/puppet/provider/augeas/augeas.rb
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/puppet-3.4.3/lib/puppet/type/augeas.rb
/usr/lib/ruby/site_ruby/1.8/augeas.rb
[vagrant@SubscriptionsAPI ~]$ ruby -e 'puts $:'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/x86_64-linux
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/vendor_ruby/2.0.0
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/vendor_ruby/2.0.0/x86_64-linux
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/vendor_ruby
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-linuxе
我这样认为对吗?如果是,我该如何为特定的 Ruby 版本安装 augeas?或者修改 ruby 包含路径是否更简洁?
答案1
打包的 ruby 库和 RVM 是两个独立的环境。您不能这样混合使用它们,您需要选择使用哪一个。
因此您需要:
- 使用包安装 ruby Augeas 绑定
- 或者在 RVM 中安装 Puppet