Facter::Util::Uptime:Module 的未定义方法 get_uptime (NoMethodError)
我正在尝试设置一个木偶节点,但 rubygems 似乎没有行为。
如果我通过它自己的二进制文件(/usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter)在cli上运行facter,它工作正常,但是如果我通过安装的二进制文件运行它rubygems (/usr/bin/facter),它抛出:
/usr/lib/ruby/1.8/facter/uptime.rb:11: undefined method `get_uptime' for Facter::Util::Uptime:Module (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:73:in `load'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:73:in `load_file'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:38:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:33:in `each'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:33:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:30:in `each'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:30:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/collection.rb:90:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter.rb:95:in `to_hash'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter:137
from /usr/bin/facter:19:in `load'
from /usr/bin/facter:19
我尝试删除 rubygems 并重新安装以及重新安装 gem,但似乎没有任何效果。
我假设某些东西缓存在某处,因为当我尝试运行木偶时它会抛出相同的错误。
有什么想法吗?
I'm trying to setup a puppet node, but rubygems doesn't seem to behave.
If I run facter on the cli via it's own binary (/usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter), it works fine, but if I run it through the binary installed by rubygems (/usr/bin/facter), it throws:
/usr/lib/ruby/1.8/facter/uptime.rb:11: undefined method `get_uptime' for Facter::Util::Uptime:Module (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:73:in `load'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:73:in `load_file'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:38:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:33:in `each'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:33:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:30:in `each'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/loader.rb:30:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter/util/collection.rb:90:in `load_all'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/lib/facter.rb:95:in `to_hash'
from /usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter:137
from /usr/bin/facter:19:in `load'
from /usr/bin/facter:19
I've tried removing rubygems and reinstalling as well as reinstalling the gem, but nothing seems to work.
I'm assuming something is cached somewhere, because it throws the same error when I'm trying to run puppet.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您可能在与 rubygems 一起安装之前已经在 rubygems 之外安装了
facter
。您会注意到堆栈跟踪中的最终文件是
/usr/lib/ruby/1.8/facter/uptime.rb
而不是/usr/lib/ruby/gems/ 中的文件1.8/gems/facter-1.5.8
。您应该检查 /usr/lib/ruby/1.8/facter 中的文件是否确实只是 Factor 的旧版本,如果是,您应该能够删除它们或将它们移动到不同名称的文件目录,它将解决您的问题。
It looks like you may have installed
facter
outside of rubygems before installing it with rubygems.You'll notice the final file in the stacktrace is
/usr/lib/ruby/1.8/facter/uptime.rb
instead of being a file in/usr/lib/ruby/gems/1.8/gems/facter-1.5.8
.You should check if the files in
/usr/lib/ruby/1.8/facter
are indeed just an older version of factor and if so, you should be able to delete them or move them to a differently named directory and it will fix your problems.