Puppet

Puppet 在多個 ruby 版本環境中無法與 augeas 一起使用

  • September 1, 2015

我正在嘗試使 puppet 與 augeas 一起工作,但它抱怨沒有 augeas 提供者。一些Google搜尋建議

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包含路徑更乾淨?

打包的 ruby​​ 庫和 RVM 是兩個獨立的環境。你不能像那樣混合它們,你需要選擇使用哪一個。

所以你需要:

  • 使用包安裝 ruby​​ Augeas 綁定
  • 或在 RVM 中安裝 Puppet

引用自:https://serverfault.com/questions/718329