Couchbase ruby gem wont install

Running Centos 6
Have Dependencies installed:
Package libcouchbase2-libevent-2.1.3-1.x86_64 already installed and latest version
Package libcouchbase-devel-2.1.3-1.x86_64 already installed and latest version

Output from Gem install:
[root@lb-dev /]# gem install couchbase
Building native extensions. This could take a while…
ERROR: Error installing couchbase:
ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby 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:
–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=/usr/local/rvm/rubies/ruby-1.9.3-p448/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}/lib

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p448/gems/couchbase-1.3.3 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p448/gems/couchbase-1.3.3/ext/couchbase_ext/gem_make.out
[root@lb-dev /]#

Tried --with-libcouchbase-dir /usr/local/lib

" invalid option: --with-couchbase-dir"

Help?

Results logged to /usr/local/rvm/gems/ruby-1.9.3-p448/gems/couchbase-1.3.3/ext/couchbase_ext/gem_make.out

could you attach or paste the log? (using monospace font please :slight_smile:

[root@lb-dev ~]# cat /usr/local/rvm/gems/ruby-1.9.3-p448/gems/couchbase-1.3.3/ext/couchbase_ext/gem_make.out
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby 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:
–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=/usr/local/rvm/rubies/ruby-1.9.3-p448/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}/lib

Does that help?

the message clearly states that it cannot find libcouchbase. Could you check without rvm? Make sure it doesn’t modify your environment.

Just verified with official CentOS 6 and ruby

Setup official CentOS 6 AMI: http://wiki.centos.org/Cloud/AWS

Connect to instance and run through these steps

yum install -y wget
wget -O/etc/yum.repos.d/couchbase.repo http://packages.couchbase.com/rpm/couchbase-centos62-x86_64.repo
yum check-update
yum install -y libcouchbase-devel
yum groupinstall -y "Development Tools"
yum install -y zlib-devel
wget http://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz
tar zxvf ruby-1.9.3-p448.tar.gz
cd ruby-1.9.3-p448
./configure --disable-install-doc --disable-install-rdoc --disable-install-capi && make install
gem install couchbase

Verify with IRB

irb(main):001:0> require 'couchbase'
=> true
irb(main):002:0> Couchbase::VERSION
=> "1.3.3"
irb(main):003:0> Couchbase.libcouchbase_version
=> "2.1.3"

Verified it works with your method.

The difference here for anyone still lost is the installation procedure on the couchbase-ruby-client webpage [https://github.com/couchbase/couchbase-ruby-client#centos-redhat-and-rpm-based-systems] gives different repo information for /etc/yum.repos.d/couchbase.repo:

Incorrect Install Errors

cat /etc/yum.repos.d/couchbase.repo

[couchbase]
name = Couchbase package repository
baseurl = http://packages.couchbase.com/rpm/5.5/x86_64

Correct

wget -O/etc/yum.repos.d/couchbase.repo http://packages.couchbase.com/rpm/couchbase-centos62-x86_64.repo

#cat /etc/yum.repos.d/couchbase.repo
[couchbase]
name = Couchbase package repository
baseurl = http://packages.couchbase.com/rpm/6.2/x86_64
gpgcheck = 1
gpgkey = http://packages.couchbase.com/rpm/couchbase-rpm.key

If you read that file carefully, you will notice “using the correct architecture” which means it is just the template. Thanks, I will make it more clear