4

I am using Windows and my Gemfile has this line:

gem 'rugged'

When I run bundle install it's giving 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'm guessing it has something to do with libgit2 but I'm not sure.

Azolo
  • 4,353
  • 1
  • 23
  • 31
Srini Vedula
  • 129
  • 2
  • 9

1 Answers1

3

This is actually a question I'm surprised isn't asked more. But rugged requires CMake & pkg-config in order to compile correctly.

Just because we can, we will extract them into the DevKit itself.

First let's grab a copy of each:

CMake is fairly straight forward, here's the download link.
pkg-config is a little bit more complicated, it has some dependencies and such. However, there's a nice package bundled with the dependencies.

Then Extract the proper files into the DevKit

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

Try installing again and it should just work and you don't dirty your PATH with more stuff.

Azolo
  • 4,353
  • 1
  • 23
  • 31
  • thanks dude....now there is a new area where i stuck..it has to do with libv8 and rubyracer on windows pc. – Srini Vedula Jul 06 '15 at 19:58
  • That one should be answered here somewhere, if not ask another question. – Azolo Jul 06 '15 at 20:01
  • thanks dude....now there is a new area where i stuck..it has to do with libv8 and rubyracer on windows pc. A lot has been said Like http://stackoverflow.com/questions/19673714/rails-gem-install-error-error-installing-libv8-error-failed-to-build-gem-nati and so on. But they seem to be not working. I tried running C:\Sooraj\Playdrone\playdrone-master>gem install libv8 -v '3.16.14.3' -- --with-system-v8 first and then when i do bundle install below error is coming http://stackoverflow.com/questions/31254645/libv8-and-rubyracer-error-after-using-gem-install-libv8-v-3-16-14-3-with – Srini Vedula Jul 06 '15 at 20:06