English 中文(简体)
undefined method get_uptime for Facter::Util::Uptime:Module (NoMethodError)
原标题:

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?

最佳回答

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.

问题回答

暂无回答




相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签