1

我在 Windows 上运行 ruby​​,通过 ruby​​ 安装程序安装了 1.9.3。我已经安装了chefruby​​ gem,但我不能使用chef-clientknife从命令行。

这是命令行的精简输出。怎么了?

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)>'

ps版本号:

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

C:\>gem -v
2.1.8
4

1 回答 1

1

如果您使用的是 Chef 11.6.2(最新版本),您可能需要降级到 11.6.0。11.6.2 使用 mixlib-shellout,但不幸的是只有 1.1,而且它的 FFI 依赖项的版本非常低。降级到 11.6.0 应该暂时解决这个问题,他们的主分支现在正在使用 mixlib-shellout 1.2,所以它应该很快就会得到修复......

于 2013-10-14T16:46:11.373 回答