Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 1.8.x

Extconf failed when gem install couchbase

7 replies [Last post]
  • Login or register to post comments
Tue, 01/31/2012 - 09:47
coralie.ve
Offline
Joined: 01/31/2012
Groups: None

Hello

I tried to install couchbase client. I follow Installing the Couchbase Client Library for ruby client.
But when I run gem install couchbase, I had the following error.

Building native extensions.  This could take a while...
ERROR:  Error installing couchbase:
	ERROR: Failed to build gem native extension.
 
        /usr/local/ruby/bin/ruby extconf.rb
checking for event_init() in -levent... yes
checking for libcouchbase_create() in -lcouchbase... no
*** 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/ruby/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
	--with-eventlib
	--without-eventlib
	--with-couchbaselib
	--without-couchbaselib
 
 
Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.9.1/gems/couchbase-1.0.0 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.9.1/gems/couchbase-1.0.0/ext/couchbase_ext/gem_make.out

In my mkmf.log I have the following :

"gcc -o conftest -I/usr/local/ruby/include/ruby-1.9.1/i686-linux -I/usr/local/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/ruby/include/ruby-1.9.1 -I. -I/usr/local/include -I/usr/local/ruby/include -I/usr/include  -D_FILE_OFFSET_BITS=64   -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -std=c99 -Wall -Wextra  conftest.c  -L. -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/lib -Wl,-R/usr/lib -L.  -rdynamic -Wl,-export-dynamic     -Wl,-R -Wl,/usr/local/ruby/lib -L/usr/local/ruby/lib -lruby-static  -lpthread -lrt -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */
 
"gcc -I/usr/local/ruby/include/ruby-1.9.1/i686-linux -I/usr/local/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/ruby/include/ruby-1.9.1 -I. -I/usr/local/include -I/usr/local/ruby/include -I/usr/include  -D_FILE_OFFSET_BITS=64   -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -std=c99 -Wall -Wextra    -c conftest.c"
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3:   #include <stdarg.h>
 4:   int foo(int x, ...) {
 5:     va_list va;
 6:     va_start(va, x);
 7:     va_arg(va, int);
 8:     va_arg(va, char *);
 9:     va_arg(va, double);
10:     return 0;
11:   }
12:   int main() {
13:     return foo(10, "", 3.14);
14:     return 0;
15:   }
/* end */
 
have_library: checking for event_init() in -levent... -------------------- yes
 
"gcc -o conftest -I/usr/local/ruby/include/ruby-1.9.1/i686-linux -I/usr/local/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/ruby/include/ruby-1.9.1 -I. -I/usr/local/include -I/usr/local/ruby/include -I/usr/include  -D_FILE_OFFSET_BITS=64   -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -std=c99 -Wall -Wextra  conftest.c  -L. -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/lib -Wl,-R/usr/lib -L.  -rdynamic -Wl,-export-dynamic     -Wl,-R -Wl,/usr/local/ruby/lib -L/usr/local/ruby/lib -lruby-static -levent  -lpthread -lrt -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <event.h>
4: 
5: /*top*/
6: int main() {return 0;}
7: int t() { void ((*volatile p)()); p = (void ((*)()))event_init; return 0; }
/* end */
 
--------------------
 
have_library: checking for libcouchbase_create() in -lcouchbase... -------------------- no
 
"gcc -o conftest -I/usr/local/ruby/include/ruby-1.9.1/i686-linux -I/usr/local/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/ruby/include/ruby-1.9.1 -I. -I/usr/local/include -I/usr/local/ruby/include -I/usr/include  -D_FILE_OFFSET_BITS=64   -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -std=c99 -Wall -Wextra  conftest.c  -L. -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/lib -Wl,-R/usr/lib -L.  -rdynamic -Wl,-export-dynamic    -levent  -Wl,-R -Wl,/usr/local/ruby/lib -L/usr/local/ruby/lib -lruby-static -lcouchbase -levent  -lpthread -lrt -ldl -lcrypt -lm   -lc"
conftest.c:3:36: error: libcouchbase/couchbase.h: No such file or directory
conftest.c: In function ‘t’:
conftest.c:7: error: ‘libcouchbase_create’ undeclared (first use in this function)
conftest.c:7: error: (Each undeclared identifier is reported only once
conftest.c:7: error: for each function it appears in.)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <libcouchbase/couchbase.h>
4: 
5: /*top*/
6: int main() {return 0;}
7: int t() { void ((*volatile p)()); p = (void ((*)()))libcouchbase_create; return 0; }
/* end */
 
"gcc -o conftest -I/usr/local/ruby/include/ruby-1.9.1/i686-linux -I/usr/local/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/ruby/include/ruby-1.9.1 -I. -I/usr/local/include -I/usr/local/ruby/include -I/usr/include  -D_FILE_OFFSET_BITS=64   -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -std=c99 -Wall -Wextra  conftest.c  -L. -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L/usr/lib -Wl,-R/usr/lib -L.  -rdynamic -Wl,-export-dynamic    -levent  -Wl,-R -Wl,/usr/local/ruby/lib -L/usr/local/ruby/lib -lruby-static -lcouchbase -levent  -lpthread -lrt -ldl -lcrypt -lm   -lc"
conftest.c:3:36: error: libcouchbase/couchbase.h: No such file or directory
conftest.c: In function ‘t’:
conftest.c:7: warning: implicit declaration of function ‘libcouchbase_create’
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <libcouchbase/couchbase.h>
4: 
5: /*top*/
6: int main() {return 0;}
7: int t() { libcouchbase_create(); return 0; }
/* end */
 
--------------------

What did I need to do to make it work ?

Thank you !

Top
  • Login or register to post comments
Wed, 02/01/2012 - 09:36
coralie.ve
Offline
Joined: 01/31/2012
Groups: None

Find out that I needed to install library header DEB too.
So now I have installed gem couchbase.

The thing is that I try to migrate from couchbase server 2.0.0 to the new stable version 1.8.0.So I install the new server and the new gem. But where I had no problem to access my server with the previous version, now I can't add a user in my database or do anything else : I had some NoMethodError.

actionpack (3.2.1) lib/action_controller/metal/hide_actions.rb:36:in `visible_action?'
actionpack (3.2.1) lib/action_controller/metal/hide_actions.rb:18:in `method_for_action'
actionpack (3.2.1) lib/action_controller/metal/implicit_render.rb:14:in `method_for_action'
actionpack (3.2.1) lib/action_controller/metal/compatibility.rb:61:in `method_for_action'
actionpack (3.2.1) lib/abstract_controller/base.rb:115:in `process'
actionpack (3.2.1) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.1) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.1) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:66:in `call'
actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:66:in `dispatch'
actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:30:in `call'
journey (1.0.1) lib/journey/router.rb:68:in `block in call'
journey (1.0.1) lib/journey/router.rb:56:in `each'
journey (1.0.1) lib/journey/router.rb:56:in `call'
actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:589:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/cookies.rb:338:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `_run__685078722__call__1033714611__callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.1) lib/rails/engine.rb:479:in `call'
railties (3.2.1) lib/rails/application.rb:220:in `call'
railties (3.2.1) lib/rails/railtie/configurable.rb:30:in `method_missing'
thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.3.1) lib/thin/connection.rb:78:in `catch'
thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.3.1) lib/thin/connection.rb:53:in `process'
thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
thin (1.3.1) lib/thin/server.rb:159:in `start'
thin (1.3.1) lib/thin/controllers/controller.rb:86:in `start'
thin (1.3.1) lib/thin/runner.rb:185:in `run_command'
thin (1.3.1) lib/thin/runner.rb:151:in `run!'
thin (1.3.1) bin/thin:6:in `<top (required)>'
/usr/bin/thin:19:in `load'
/usr/bin/thin:19:in `<main>'

Nothing change in my .rb files, the only thing that change is the couchbase server version and the gem couchbase version. When I install back the previous version everything works fine.

Top
  • Login or register to post comments
Wed, 02/08/2012 - 00:34
ingenthr
Offline
Joined: 03/16/2010
Groups:

Sorry for the trouble, we'll have a quick look at this to see if we can spot why there's an issue.

Top
  • Login or register to post comments
Wed, 02/08/2012 - 01:39
coralie.ve
Offline
Joined: 01/31/2012
Groups: None

It turns out that previous couchbase gem version (0.9.8) works, but when I upgrade to 1.0.0 version this error occurred.

Top
  • Login or register to post comments
Wed, 02/08/2012 - 02:14
avsej
avsej's picture
Offline
Joined: 06/15/2011
Groups: None

Hi, first of all, the 0.9.8 version have views support, which was temporarily disabled in 1.0.0 version and will be enabled in the next version. Next, I cannot find the the missing method in your stacktrace. Could you show the snippet of the code which generates the error?

__________________

Find me on FreeNode IRC in #libcouchbase channel

Top
  • Login or register to post comments
Wed, 02/08/2012 - 03:04
coralie.ve
Offline
Joined: 01/31/2012
Groups: None

This is the code which generate this error stacktrace when I call login methode.

Model :

class User
 
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Callbacks
  extend ActiveModel::Naming
 
  attr_accessor :key, :fuid, :fullname, :nickname, :created_at, :game_state
  @@keys = [:key, :fuid, :fullname, :nickname, :created_at, :game_state]
 
  validates :fuid, :presence => true
 
  def initialize(attributes = {})
    @errors = ActiveModel::Errors.new(self)
 
    attributes.each do |name, value|
      next unless @@keys.include?(name.to_sym)
      send("#{name}=", value)
    end
 
    if self.fullname.nil?
      self.fullname = "Before_Update"
    end
 
    if self.fullname == ""
      self.fullname = "Before_Update"
    end
 
    p "############################################"
    p "nickname: #{nickname}"
    if self.nickname.nil? 
      p "fullname: #{fullname}"
      fullname_tmp = self.fullname.split(" ")
      p "fullname_tmp: #{fullname_tmp}"
      p "fullname_tmp0: #{fullname_tmp[0]}"
      p "fullname_tmp1: #{fullname_tmp[1]}"
      p "fullname_tmp1.1: #{fullname_tmp[1][0..0]}"
      self.nickname = "#{fullname_tmp[0]} #{fullname_tmp[1][0..0]}."
      p "nickname: #{nickname}"
    end
    p "############################################"
 
    self.key = "fb:#{self.fuid}"
    self.created_at ||= Time.now
  end
 
  def save
    return false unless valid?
 
    Couch.client.set(
      self.key, {
        :type => self.class.to_s.downcase,
        :key => self.key,
        :fuid => self.fuid,
        :game_state => self.game_state,
        :fullname => self.fullname,
        :nickname => self.nickname,
        :created_at => self.created_at
      }
    )
 
    return true
  end
 
  def self.find(key)
    return nil unless key
    begin
      doc = Couch.client.get(key)
      self.new(doc)
    rescue Memcached::NotFound => e
      nil
    end
  end
 
  def self.by_fuid
    results = design.by_fuid.entries
  end
 
end

Controller

class UsersController < ApplicationController
 
  def login
 
    if User.find("fb:#{params[:user][:fuid]}").nil? 
      @user = User.new params[:user]
      p "####################################" 
      p "fullname: #{@user.fullname}"
      fullname_tmp = @user.fullname.split(" ")
      p "fullname_tmp: #{fullname_tmp}"
      p "fullname_tmp0: #{fullname_tmp[0]}"
      p "fullname_tmp1: #{fullname_tmp[1]}"
      p "fullname_tmp1.1: #{fullname_tmp[1][0..0]}"
      p "####################################"
      if @user.save
        render :json => @user
      else
        render :nothing => true, :status => 500
      end
    else
      user_current = User.find("fb:#{params[:user][:fuid]}")
      if user_current.fullname.nil?
        user_current.fullname = params[:user][:fullname]
 
        if user_current.save
          render :json => user_current
        else
          render :nothing => true, :status => 500
        end 
      else
        render :json => user_current
      end
    end
  end
 
  def update
    u = User.find(params[:user][:key])
    u.game_state = params[:user][:game_state]
 
    if u.save
      render :nothing => true
    else
      render :nothing => true, :status => 500
    end
  end
 
  def show
    #render :json => User.find(params[:id])
 
    render :json => User.by_fuid
  end
 
  def game_state
    render :json => User.find(params[:id]).game_state
  end
 
end

Top
  • Login or register to post comments
Wed, 02/08/2012 - 03:16
avsej
avsej's picture
Offline
Joined: 06/15/2011
Groups: None

From the first glance there some updates in version 1.0.0 it doesn't use "Memcached" namespace anymore you should use one of this exception classes http://rubydoc.info/gems/couchbase/Couchbase/Error Couchbase::Error::NotFound for instance. Another point is that your code is using design docs and as I said earlier, libcouchbase (and the ruby client which uses it as backend) doesn't have views support yet. It will come in the next version.

__________________

Find me on FreeNode IRC in #libcouchbase channel

Top
  • Login or register to post comments
Wed, 02/08/2012 - 03:28
coralie.ve
Offline
Joined: 01/31/2012
Groups: None

Thanks a lot, I will stay with 0.9.8 version for now and upgrade when the next version will come. I will correct the memcached namespace.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker