Facter::Util::Uptime:Module 的未定义方法 get_uptime (NoMethodError)

发布于 2024-09-25 07:08:51 字数 1436 浏览 2 评论 0原文

我正在尝试设置一个木偶节点,但 ruby​​gems 似乎没有行为。

如果我通过它自己的二进制文件(/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

我尝试删除 ruby​​gems 并重新安装以及重新安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

土豪我们做朋友吧 2024-10-02 07:08:52

看起来您可能在与 ruby​​gems 一起安装之前已经在 ruby​​gems 之外安装了 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文