Ruby on Windows: uninitialized constant Process::Functions::FFI (NameError)

980 Views Asked by At

I'm running ruby on windows, having installed 1.9.3 via the ruby installer. I've installed the chef ruby gem, but I cannot use chef-client or knife from the command line.

Here's the abridged output from the command line. What's going wrong?

C:\>chef-client
C:/ruby193/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:4: Use RbConfig instead of obsolete and deprecated Config.
C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/windows/core_ext.rb:31:in `<module:Functions>':
        uninitialized constant Process::Functions::FFI (NameError)
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/windows/core_ext.rb:30:in `<top (required)>'
        from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
        from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/windows.rb:26:in `<top (required)>'
        from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
        from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:33:in `<class:ShellOut>'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:26:in `<module:Mixlib>'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:24:in `<top (required)>'

P.s. version numbers:

C:\>ruby -v
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

C:\>gem -v
2.1.8
1

There are 1 best solutions below

0
On

If you're using Chef 11.6.2 (latest release) you might want to downgrade to 11.6.0. 11.6.2 uses mixlib-shellout, but unfortunately only 1.1 and it's got a really low version of the FFI dependency. Downgrading to 11.6.0 should fix this for the moment, and their master branch is using mixlib-shellout 1.2 now so it should get fixed soon....