Installing bdb-0.6.5 in ubuntu

Hello to everyone,

I’m trying to install bdb-0.6.5 on my Ubuntu machine. I was able to
install it using the following commands:

ruby extconf.rb --with-db-dir=/usr/local/berkeleydb
–with-db-lib=/usr/local/berkeleydb/lib
–with-db-include=/usr/local/berkeleydb/include

make

make install

But when I try to use it I always get the following error

/usr/local/lib/site_ruby/1.8/i486-linux/bdb.so: (NotImplementedError)
BDB needs compatible versions of libdb & db.h
you have db.h version 4.8.24 and libdb version 4.7.25

The BerkeleyDB I’m currently using is indeed version 4.8.24 and the lib
inside is version 4.8, so now I’m not sure why it’s seeing libdb 4.7.25.
After trying to check the logs when running extconf.rb I saw this line:

extconf.rb: Entering directory `src’
checking for db_version() in -ldb-4.7… yes
checking for rb_frame_this_func() in ruby.h… yes
checking for rb_block_proc() in ruby.h… yes
checking for rb_io_stdio_file() in ruby.h… no
checking for rb_block_call() in ruby.h… yes
checking for Array#insert… yes
checking for Array#values_at… yes
checking for rb_io_t in ruby.h,rubyio.h… yes
checking for DB_AFTER in db.h…yes
checking for DB_AGGRESSIVE in db.h…yes
checking for DB_APPEND in db.h…yes
checking for DB_ARCH_ABS in db.h…yes

it’s seeing a different version even if I explicitly pointed it to the
correct Berkeleydb, removing the --with-db-lib= and --with-db-include=
and just leaving the --with-db-dir=/usr/local/berkeleydb doesn’t help.

Anyone that can help me with this?

Regards,
Donald

unsubscribe

Your post is about a year old, but let me add to this thread instead of
starting another:

Well, at least yours installed! Mine does the following:

Building native extensions. This could take a while…
ERROR: Error installing bdb:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
checking for db_version() in -ldb-4.8… yes
Writing bdb_aux._c (defines), this takes a while
don’t know how to handle DB_DEGREE_2 DB_READ_COMMITTED, guessing UINT
don’t know how to handle DB_DIRTY_READ DB_READ_UNCOMMITTED, guessing
UINT

wrote 432 defines
creating Makefile

make
cc -I. -I/usr/include/ruby-1.9.1/x86_64-linux
-I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.
-I/usr/local/BerkeleyDB.4.8/include -fPIC -fno-strict-aliasing -g -g
-O2 -O2 -g -Wall -Wno-parentheses -fPIC -o bdb.o -c bdb.c
In file included from bdb.c:8:
./bdb.h:19:21: error: version.h: No such file or directory
bdb.c: In function ‘db_open’:
bdb.c:242: warning: implicit declaration of function ‘raise’
bdb.c:233: warning: unused variable ‘len’
bdb.c: In function ‘db_close’:
bdb.c:501: error: ‘struct RArray’ has no member named ‘len’
bdb.c:511: warning: format ‘%x’ expects type ‘unsigned int’, but
argument 5 has type ‘struct t_dbh *’
bdb.c:519: warning: format ‘%x’ expects type ‘unsigned int’, but
argument 5 has type ‘VALUE’
bdb.c: In function ‘db_pget’:
bdb.c:657: warning: unused variable ‘str’
bdb.c: In function ‘db_join’:
bdb.c:752: error: ‘struct RArray’ has no member named ‘len’
bdb.c:753: error: ‘struct RArray’ has no member named ‘len’
bdb.c:754: error: ‘struct RArray’ has no member named ‘ptr’
bdb.c:754: error: ‘struct RArray’ has no member named ‘ptr’
bdb.c: In function ‘db_remove’:
bdb.c:893: warning: unused variable ‘logical_db’
bdb.c: In function ‘db_rename’:
bdb.c:925: warning: unused variable ‘logical_db’
bdb.c:924: warning: unused variable ‘disk_file’
bdb.c: In function ‘db_truncate’:
bdb.c:981: warning: unused variable ‘result’
bdb.c: In function ‘db_del’:
bdb.c:1065: warning: unused variable ‘str’
bdb.c: In function ‘assoc_rescue’:
bdb.c:1118: warning: format not a string literal and no format arguments
bdb.c: In function ‘assoc_callback’:
bdb.c:1153: error: ‘struct RArray’ has no member named ‘len’
bdb.c:1157: error: ‘struct RArray’ has no member named ‘ptr’
bdb.c:1160: error: ‘struct RArray’ has no member named ‘len’
bdb.c:1166: error: ‘struct RArray’ has no member named ‘ptr’
bdb.c:1125: warning: unused variable ‘proc’
bdb.c: In function ‘db_associate’:
bdb.c:1193: warning: unused variable ‘fdp’
bdb.c: In function ‘bt_compare_callback’:
bdb.c:1249: warning: unused variable ‘proc’
bdb.c: In function ‘db_cursor’:
bdb.c:1316: warning: unused variable ‘dbc’
bdb.c: In function ‘env_close’:
bdb.c:1674: error: ‘struct RArray’ has no member named ‘len’
bdb.c:1676: error: ‘struct RArray’ has no member named ‘len’
bdb.c:1677: error: ‘struct RArray’ has no member named ‘len’
bdb.c:1680: warning: format ‘%x’ expects type ‘unsigned int’, but
argument 5 has type ‘VALUE’
bdb.c:1685: error: ‘struct RArray’ has no member named ‘len’
bdb.c:1695: warning: format ‘%x’ expects type ‘unsigned int’, but
argument 5 has type ‘struct t_envh *’
bdb.c: In function ‘env_get_cachesize’:
bdb.c:1776: warning: unused variable ‘ln’
bdb.c: In function ‘db_stat’:
bdb.c:2058: warning: enumeration value ‘DB_UNKNOWN’ not handled in
switch
bdb.c: In function ‘env_report_stderr’:
bdb.c:2569: warning: unused variable ‘rv’
bdb.c:2568: warning: unused variable ‘max’
bdb.c: In function ‘txn_finish’:
bdb.c:2956: warning: format ‘%x’ expects type ‘unsigned int’, but
argument 5 has type ‘struct t_txnh *’
make: *** [bdb.o] Error 1

And this is after a lot googling, etc. My Berkeley DB installation is
working fine, as proven by my perl bdb module. So, it has to be
something to do with bdb not working with ruby 1.9.1 … any help is
welcome!