我正在使用 Windows 和我的Gemfile
有这一行:
gem 'rugged'
当我跑步时bundle install
它给了我这个错误:
Installing rugged 0.21.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe extconf.rb --use-system-libraries
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.
Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby21/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rugged-0.21.0 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/rugged-0.21.0/gem_make.out
An error occurred while installing rugged(0.21.0), and Bundler cannot continue.
Make sure that `gem install rugged -v '0.21.0'` succeeds before
bundling.
我猜这与libgit2
但我不确定。
这实际上是一个让我很惊讶没有人问更多的问题。但rugged
需要CMake
& pkg-config
以便正确编译。
正因为我们可以,我们才会将它们提取到DevKit itself.
First让我们获取每个的副本:
CMake
相当简单,这是下载链接.
pkg-config
有点复杂,它有一些依赖关系等等。然而,有一个与依赖项捆绑在一起的好包.
Then Extract将正确的文件放入DevKit
一旦你拥有它们,你需要打开每个档案(需要 7-zip)并打开顶层存档中的文件夹。
从那里你需要提取bin
and share
从存档目录到DevKit根目录。
它应该只是将目录合并到现有目录中,并且不应覆盖或删除任何内容。
再次尝试安装,应该可以了只是工作并且你不会弄脏你的PATH
有更多的东西。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)