ruby - Windows 中的 `gem install berkshelf` 失败

标签 ruby windows chef-infra berkshelf

我正在使用这个包在 Windows 中使用 chefhttp://www.opscode.com/chef/install.msi

当我运行 $ gem install berkshelf 时,我遇到了这个错误。 我该如何解决这个错误?

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Fetching: dep_selector-1.0.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing berkshelf:
        ERROR: Failed to build gem native extension.

        C:/opscode/chef/embedded/bin/ruby.exe extconf.rb
checking for main() in -lgecodesupport... yes
checking for main() in -lgecodesupport... yes
checking for main() in -lgecodekernel... yes
checking for main() in -lgecodeint... yes
checking for main() in -lgecodeminimodel... yes
checking for main() in -lgecodesearch... yes
creating Makefile

make
generating dep_gecode-i386-mingw32.def
compiling define_dummy_init.cxx
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/O
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C
compiling dep_selector_to_gecode.cpp
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/O
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C
In file included from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libge
0,
                 from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libge
45,
                 from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libge

                 from dep_selector_to_gecode.cpp:20:
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.0/lib/dep-sel
pscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.0/lib/dep-selecto
d
compilation terminated.
make: *** [dep_selector_to_gecode.o] Error 1


Gem files will remain installed in C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_s
Results logged to C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.3/ext

这是我的环境。

$ ruby -v
ruby 1.9.3p484 (2013-11-22) [i386-mingw32]
$ where ruby
C:\opscode\chef\embedded\bin\ruby.exe

最佳答案

我在 Windows 上使用 Git bash 时发现了同样的问题,但是当使用命令窗口时 berkshelf gem 安装正常。

关于ruby - Windows 中的 `gem install berkshelf` 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23343945/

相关文章:

javascript - Node.js 通过 Grunt 运行 SASS 预处理器

ruby-on-rails - 将集合与相关对象分组

ruby - 从 git 提交生成发行说明

windows - 从命令行而不是 Windows 资源管理器命名网络驱动器

windows - 如何在 Windows 操作系统中配置或安装 GEARMAN?

ruby - Vagrant 与 librarian-chef 通过 ruby​​_build & rbenv 安装 ruby

ruby - 在 Ruby 中查找一个类的所有后代

python - 我如何理解编码错误的消息?

chef-infra - 有什么方法可以从 Chef 服务器生成并获取验证 key 吗?

chef-infra - 禁用ohai插件