Problem with hard gem installation, possibly with libgit2 on Windows

I am using Windows, and my Gemfile has the following line:

 gem 'rugged' 

When I ran bundle install , it gave me this error:

 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. 

I assume this has something to libgit2 with libgit2 , but I'm not sure.

+5
source share
1 answer

This is actually a question that I wonder do not ask anymore. But rugged requires CMake and pkg-config to compile correctly.

Just because we can, we will extract them in DevKit.

First let him take a copy of each of them:

CMake pretty straight forward, here is the download link .
pkg-config bit more complicated, it has some dependencies, etc. However, a good package is bundled with dependencies .

Then Extract the correct files in DevKit

Once you have them, you need to open each archive ( requires 7-zip ) and open the top-level folder in the archive. <f> From there you need to extract the bin and share directories from the archive to the DevKit root directory.
It should simply merge directories into existing ones, and nothing should be overwritten or deleted.

Try installing again and it should just work and you will no longer pollute your PATH .

+4
source

All Articles