代码之家  ›  专栏  ›  技术社区  ›  Andrei Serdeliuc ॐ

未定义的方法获取factor::util::uptime:模块的运行时间(NoMethodError)

  •  5
  • Andrei Serdeliuc ॐ  · 技术社区  · 14 年前

    我正在尝试设置一个木偶节点,但rubygems似乎没有表现出来。

    如果我通过自己的二进制文件(/usr/lib/ruby/gems/1.8/gems/factor-1.5.8/bin/factor)在cli上运行factor,它工作正常,但是如果我通过ruby gems安装的二进制文件(/usr/bin/factor)运行它,它会抛出:

    /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,但似乎没什么效果。

    我假设某个东西缓存在某个地方,因为当我试图运行puppet时,它会抛出相同的错误。

    有什么想法吗?

    1 回复  |  直到 9 年前
        1
  •  8
  •   eric    14 年前

    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