Unable to install couchbase gem on Windows

Hi, I’m trying to install the couchbase gem (https://github.com/couchbase/couchbase-ruby-client) on Windows Server 2012 with Ruby 2.0.0 but not having much luck. I keep getting the following error:

$ gem install couchbase ERROR: Error installing couchbase: ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb

*** 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:

Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/couchbase-1.3.2 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/couchbase-1.3.2/ext/couchbase_ext/gem_make.out
Temporarily enhancing PATH to include DevKit…
Building native extensions. This could take a while…

Ruby was installed via the one-click installer together with the devkit. I’ve tried running the install both in cygwin and the Ruby shell but get the same error.

Ruby details:

$ ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]

Any ideas? Am I doing something wrong? Everything I’ve read seems to suggest that I don’t need to install libcouchbase on Windows and that it’s included in the gem somehow.

I managed to somehow get it working by manually downloading the gem and installing it that way from http://rubygems.org/gems/couchbase/versions/1.3.2-x86-mingw32.

This isn’t clean though, still looking for a proper solution.

I didn’t verified it with 2.0.0 on windows. If you are using 1.8.7 or 1.9.x, it will automatically download correct version

I’ve created a ticket to track activity on this issue http://www.couchbase.com/issues/browse/RCBC-136

we didn’t test couchbase gem with cygwin, and I guess on this platform it will try to download and build gem from sources (like for other unix systems)

I wonder why rubyinstaller version asks you to do so. I’ve just donloaded “Ruby 2.0.0-p247” from http://rubyinstaller.org/downloads/ and it is downloading proper version from rubygems (with mingw suffix). But obviously fails in run-time. I’ve made patches to fix that and it will be available with 1.3.3 version of the gem

Great, thanks for the very fast fix. Any idea when 1.3.3 will be on rubygems.org?

Also, ruby via cygwin is the first thing I tried (instead of rubyinstaller) and unfortunately, it doesn’t let you install ruby-dev which means that any gem with native extensions will not work.

Had no choice in using Windows Server unfortunately :wink: