简体   繁体   中英

Ruby on Rails - Error installing bdb. Failed to build gem native extension

When running gem install bdb I get the following error:

Error installing bdb:
ERROR: Failed to build gem native extension.

Anyone know where I can find the bdb library for Mac OS X?

Full error:

Building native extensions.  This could take a while...
ERROR:  Error installing bdb:
ERROR: Failed to build gem native extension.
...
checking for db_version() in -ldb-5.1... 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
don't know how to handle DB_HEAP_RID_SZ (sizeof(db_pgno_t) + sizeof(db_indx_t)), guessing UINT

wrote 491 defines
creating Makefile

make
...
bdb.c:84:1: warning: "eDbE_create" redefined
bdb.c:50:1: warning: this is the location of the previous definition
bdb.c: In function ‘assoc_rescue’:
bdb.c:1200: warning: format not a string literal and no format arguments
bdb.c: In function ‘assoc_callback’:
bdb.c:1248: warning: comparison between signed and unsigned
bdb.c:1249: warning: pointer of type ‘void *’ used in arithmetic
bdb.c: In function ‘env_set_cachesize’:
bdb.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
bdb.c:1831: warning: implicit conversion shortens 64-bit value into a 32-bit value
bdb.c: In function ‘env_txn_stat’:
bdb.c:2299: warning: comparison between signed and unsigned
bdb.c: In function ‘env_repmgr_set_local_site’:
bdb.c:3005: error: ‘DB_ENV’ has no member named ‘repmgr_set_local_site’
bdb.c: In function ‘env_repmgr_add_remote_site’:
bdb.c:3024: error: ‘DB_ENV’ has no member named ‘repmgr_add_remote_site’
bdb.c:3331:1: warning: "eDbE_create" redefined
bdb.c:84:1: warning: this is the location of the previous definition
bdb.c:3424:1: warning: "ENV_LOG_CONFIG_FUNC" redefined
bdb.c:2533:1: warning: this is the location of the previous definition
make: *** [bdb.o] Error 1

Did you see the instructions on the bdb page?

As a Gem

At the moment this library is not available on RubyForge. To install it as a gem, do the following:

[sudo] gem install bdb

For Berkeley DB v4.7 installed from MacPorts do the following:

[sudo] env ARCHFLAGS="-arch i386" gem install bdb This assumes you're on OS X and BerkeleyDB wasn't compiled as a universal binary.

So it looks like you need to install berkeley db via macports/brew to get the Gem to install.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM