Cannot install couchbase gem on Mac (OSX Yosemite 10.10.2)


#1

I’ve installed libcouchbase successfully:

brew install libcouchbase

==> Installing libcouchbase dependency: libevent

==> Downloading https://homebrew.bintray.com/bottles/libevent-2.0.22.yosemite.bottle.tar.

######################################################################## 100.0%

==> Pouring libevent-2.0.22.yosemite.bottle.tar.gz

🍺  /usr/local/Cellar/libevent/2.0.22: 48 files, 1.8M

==> Installing libcouchbase

==> Downloading https://homebrew.bintray.com/bottles/libcouchbase-2.4.7.yosemite.bottle.t

######################################################################## 100.0%

==> Pouring libcouchbase-2.4.7.yosemite.bottle.tar.gz

🍺  /usr/local/Cellar/libcouchbase/2.4.7: 57 files, 1.5M

When I attempt to run the 'gem install couchbase;, I get the error stack as shown below, I’ve tried it a few times, opening a new terminal, but it still doesn’t work.

Building native extensions.  This could take a while...

ERROR:  Error installing couchbase:

ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

checking for lcb_iops_wire_bsd_impl2(NULL, 0) in -lcouchbase... no

**********************************************************************

* You must install libcouchbase >= 2.4.0


**********************************************************************

*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

--with-libcouchbase-dir

--without-libcouchbase-dir

--with-libcouchbase-include

--without-libcouchbase-include=${libcouchbase-dir}/include

--with-libcouchbase-lib

--without-libcouchbase-lib=${libcouchbase-dir}/

--with-couchbaselib

--without-couchbaselib

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/couchbase-1.3.11 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/gems/couchbase-1.3.11/ext/couchbase_ext/gem_make.out

#2

If you are using system ruby, you have to install fat libcouchbase library: brew install libcouchbase --universal


#3

That did the trick! Thank you very much. (as an aside, would it be possible to add this vital detail to the official installation page?)