public
Last active

Installing the wordnet gem on OSX, as of February 9 2012

  • Download Gist
gistfile1.md
Markdown

Getting the wordnet gem, version 0.0.5, working is a little tricky at the moment. It's being rewritten but isn't released yet and the dbd gem is in a similar state.

These steps got it working for me on OS X Lion and MRI 1.8.7. On 1.9.2 convertdb.rb segfaults.

WordNet

Download WordNet from http://wordnet.princeton.edu/wordnet/download/current-version/

$ ./configure
$ make
$ make install

BerkeleyDB

This uses homebrew (http://mxcl.github.com/homebrew/). If you use a different package manager then you will have to adjust the --with-db-dir below.

$ brew install berkeley-db

ruby-bdb gem

$ git clone https://github.com/knu/ruby-bdb
$ cd ruby-bdb
$ git checkout 6aa8054e022fa38055fd441de98b65fd392b8dcb
$ ruby extconf.rb --with-db-dir=/usr/local/Cellar/berkeley-db/5.1.19
$ make
$ make install

wordnet gem

$ gem install wordnet
$ gem which wordnet
$ cd your/wordnet/path
$ ruby convertdb.rb
$ mv ruby-wordnet/ `ruby -e "require 'rbconfig'; print Config::CONFIG['datadir']"`

Using it

$ irb
> require 'rubygems'
> require 'wordnet'
> lex = WordNet::Lexicon.new
> frog = lex.lookup_synsets('frog', WordNet::Noun)
> frog.first.hypernyms.first.overview
  => "amphibian [noun] -- (cold-blooded vertebrate typically living on land but breeding in water; aquatic larvae undergo metamorphosis into adult form)" 

There is a typo on line 24.
It is cd ruby-bdb not cd ruby-dbd !

When I ran the line
ruby extconf.rb --with-db-dir=/usr/local/Cellar/berkeley-db/5.3.15

I got the following error:
extconf.rb:109: libdb not found (RuntimeError)
from extconf.rb:87:in `catch'
from extconf.rb:87

This for the extconf.rb file inside ruby-bdb/ext/bdb. Is this right?

@lramach, thanks, I've fixed the typo.

You're getting that error because you are at the latest version of the ruby-bdb repo. You need to git co dbfa77b4b97162dc63e1183dafb213f4c5a07a2e to get the working version. Then extconf.rb will be in the top level directory.

Thanks for the help! But the line 'git co dbfa77b4b97162dc63e1183dafb213f4c5a07a2e' fails. What exactly does 'co' stand for?
Also, I tried the same steps with one of the older versions of ruby-bdb (0.6.5) and that didn't work either!

Ah, sorry, co is a shortcut I have. Replace it with checkout and it should work.

On 9 mar 2012, at 00:42, Lakshmi Ramachandranreply@reply.github.com wrote:

Thanks for the help! But the line 'git co dbfa77b4b97162dc63e1183dafb213f4c5a07a2e' fails. What exactly does 'co' stand for?
Also, I tried the same steps with one of the older versions of ruby-bdb (0.6.5) and that didn't work either!


Reply to this email directly or view it on GitHub:
https://gist.github.com/1779371

I tried checkout and there is no extconf.rb in the top level directory. What is the version of ruby-bdb you are using?
Thanks again for the help!

You did git clone https://github.com/knu/ruby-bdb, then cd ruby-bdb and then git checkout dbfa77b4b97162dc63e1183dafb213f4c5a07a2e?

When I do that I get an extconf.rb in the ruby-bdb directory. And a VERSION file that says 0.6.7.

Thats strange! I did the exact same things, yet no extconf.rb file (not in the top directory atleast). The version is correct through.

Ah! I did it again and couldn't see the extconf.rb either. So I double checked and in the original notes I have git checkout dbfa77b4b97162dc63e1183dafb213f4c5a07a2e^

Notice the ^ at the end, it tells git to check out the parent of dbfa77b4b97162dc63e1183dafb213f4c5a07a2e, which is 6aa8054e022fa38055fd441de98b65fd392b8dcb.

I should just have put 6aa8054e022fa38055fd441de98b65fd392b8dcb in the original instructions instead. Sorry!

So the correct is git checkout 6aa8054e022fa38055fd441de98b65fd392b8dcb. Then extconf.rb will be there. And there will be no VERSION file.

Thanks! That worked!
But the ruby extconf.rb --with-db-dir=/usr/local/Cellar/berkeley-db/5.3.15 (I have the 5.3.15 version) resulted in the following error

extconf.rb:109: libdb not found (RuntimeError)
from extconf.rb:87:in catch'
from extconf.rb:87
extconf.rb: Leaving directory
src'

This is strange because extconf.rb doesn't have a line 109! There are only 83 lines of code in the file!

Hmm, odd. And it's not accidentally executing the ext/bdb/extconf.rb file from the erroneous checkout? That one is 162 lines.

Thats not likely since I explicitly specified the location of the extconf.rb file on another run and I got the same error!

Odd indeed. Here's the output I get when I run ruby extconf.rb --with-db-dir=/usr/local/Cellar/berkeley-db/5.1.19:

extconf.rb: Entering directory `src'
extconf.rb:79: warning: Insecure world writable dir /usr/local in PATH, mode 040777
checking for db_version() in -ldb-4.7... no
checking for db_version_4007() in -ldb-4.7... no
checking for db_version() in -ldb47... no
checking for db_version_4007() in -ldb47... no
checking for db_version() in -ldb-4.6... no
checking for db_version_4006() in -ldb-4.6... no
checking for db_version() in -ldb46... no
checking for db_version_4006() in -ldb46... no
checking for db_version() in -ldb-4.5... no
checking for db_version_4005() in -ldb-4.5... no
checking for db_version() in -ldb45... no
checking for db_version_4005() in -ldb45... no
checking for db_version() in -ldb-4.4... no
checking for db_version_4004() in -ldb-4.4... no
checking for db_version() in -ldb44... no
checking for db_version_4004() in -ldb44... no
checking for db_version() in -ldb-4.3... no
checking for db_version_4003() in -ldb-4.3... no
checking for db_version() in -ldb43... no
checking for db_version_4003() in -ldb43... no
checking for db_version() in -ldb-4.2... no
checking for db_version_4002() in -ldb-4.2... no
checking for db_version() in -ldb42... no
checking for db_version_4002() in -ldb42... no
checking for db_version() in -ldb-4.1... no
checking for db_version_4001() in -ldb-4.1... no
checking for db_version() in -ldb41... no
checking for db_version_4001() in -ldb41... no
checking for db_version() in -ldb-4.0... no
checking for db_version_4000() in -ldb-4.0... no
checking for db_version() in -ldb40... no
checking for db_version_4000() in -ldb40... no
checking for db_version() in -ldb4... no
checking for db_version_4000() in -ldb4... no
checking for db_version() in -ldb3... no
checking for db_version_3000() in -ldb3... no
checking for db_version() in -ldb2... no
checking for db_version_2000() in -ldb2... no
checking for db_version() in -ldb... yes
checking for ruby/io.h... no
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
checking for DB_ARCH_DATA in db.h...yes
checking for DB_ARCH_LOG in db.h...yes
checking for DB_AUTO_COMMIT in db.h...yes
checking for DB_BEFORE in db.h...yes
checking for DB_BTREE in db.h...yes
checking for DB_CACHED_COUNTS in db.h...no
checking for DB_CDB_ALLDB in db.h...yes
checking for DB_CHECKPOINT in db.h...no
checking for DB_CHKSUM in db.h...yes
checking for DB_CHKSUM_SHA1 in db.h...no
checking for DB_CLIENT in db.h...no
checking for DB_CONFIG in db.h...no
checking for DB_CONSUME in db.h...yes
checking for DB_CONSUME_WAIT in db.h...yes
checking for DB_CREATE in db.h...yes
checking for DB_CURLSN in db.h...no
checking for DB_CURRENT in db.h...yes
checking for DB_DBT_MALLOC in db.h...yes
checking for DB_DBT_PARTIAL in db.h...yes
checking for DB_DBT_REALLOC in db.h...yes
checking for DB_DBT_USERMEM in db.h...yes
checking for DB_DIRECT_DB in db.h...yes
checking for DB_DIRECT_LOG in db.h...no
checking for DB_DIRTY_READ in db.h...yes
checking for DB_DONOTINDEX in db.h...yes
checking for DB_DSYNC_LOG in db.h...no
checking for DB_DUP in db.h...yes
checking for DB_DUPSORT in db.h...yes
checking for DB_EID_BROADCAST in db.h...yes
checking for DB_EID_INVALID in db.h...yes
checking for DB_ENCRYPT in db.h...yes
checking for DB_ENCRYPT_AES in db.h...yes
checking for DB_ENV_THREAD in db.h...no
checking for DB_EVENT_PANIC in db.h...yes
checking for DB_EVENT_REP_CLIENT in db.h...yes
checking for DB_EVENT_REP_ELECTED in db.h...yes
checking for DB_EVENT_REP_MASTER in db.h...yes
checking for DB_EVENT_REP_NEWMASTER in db.h...yes
checking for DB_EVENT_REP_PERM_FAILED in db.h...yes
checking for DB_EVENT_REP_STARTUPDONE in db.h...yes
checking for DB_EVENT_WRITE_FAILED in db.h...yes
checking for DB_EXCL in db.h...yes
checking for DB_FAST_STAT in db.h...yes
checking for DB_FIRST in db.h...yes
checking for DB_FIXEDLEN in db.h...no
checking for DB_FLUSH in db.h...yes
checking for DB_FORCE in db.h...yes
checking for DB_GET_BOTH_RANGE in db.h...yes
checking for DB_GET_RECNO in db.h...yes
checking for DB_GET_BOTH in db.h...yes
checking for DB_HASH in db.h...yes
checking for DB_HOME in db.h...no
checking for DB_IGNORE_LEASE in db.h...yes
checking for DB_INCOMPLETE in db.h...no
checking for DB_INIT_CDB in db.h...yes
checking for DB_INIT_LOCK in db.h...yes
checking for DB_INIT_LOG in db.h...yes
checking for DB_INIT_MPOOL in db.h...yes
checking for DB_INIT_REP in db.h...yes
checking for DB_INIT_TXN in db.h...yes
checking for DB_JOINENV in db.h...yes
checking for DB_JOIN_ITEM in db.h...yes
checking for DB_JOIN_NOSORT in db.h...yes
checking for DB_KEYEMPTY in db.h...yes
checking for DB_KEYEXIST in db.h...yes
checking for DB_KEYFIRST in db.h...yes
checking for DB_KEYLAST in db.h...yes
checking for DB_LAST in db.h...yes
checking for DB_LOCKDOWN in db.h...yes
checking for DB_LOCK_CONFLICT in db.h...no
checking for DB_LOCK_DEADLOCK in db.h...yes
checking for DB_LOCK_DEFAULT in db.h...yes
checking for DB_LOCK_EXPIRE in db.h...yes
checking for DB_LOCK_GET in db.h...yes
checking for DB_LOCK_GET_TIMEOUT in db.h...yes
checking for DB_LOCK_IREAD in db.h...yes
checking for DB_LOCK_IWR in db.h...yes
checking for DB_LOCK_IWRITE in db.h...yes
checking for DB_LOCK_MAXLOCKS in db.h...yes
checking for DB_LOCK_MINLOCKS in db.h...yes
checking for DB_LOCK_MINWRITE in db.h...yes
checking for DB_LOCK_NG in db.h...yes
checking for DB_LOCK_NOTGRANTED in db.h...yes
checking for DB_LOCK_NOTHELD in db.h...no
checking for DB_LOCK_NOWAIT in db.h...yes
checking for DB_LOCK_OLDEST in db.h...yes
checking for DB_LOCK_PUT in db.h...yes
checking for DB_LOCK_PUT_ALL in db.h...yes
checking for DB_LOCK_PUT_OBJ in db.h...yes
checking for DB_LOCK_RANDOM in db.h...yes
checking for DB_LOCK_READ in db.h...yes
checking for DB_LOCK_TIMEOUT in db.h...yes
checking for DB_LOCK_WRITE in db.h...yes
checking for DB_LOCK_YOUNGEST in db.h...yes
checking for DB_LOG_AUTOREMOVE in db.h...no
checking for DB_LOG_AUTO_REMOVE in db.h...yes
checking for DB_LOG_DIRECT in db.h...yes
checking for DB_LOG_DSYNC in db.h...yes
checking for DB_LOG_INMEMORY in db.h...no
checking for DB_LOG_IN_MEMORY in db.h...yes
checking for DB_LOG_ZERO in db.h...yes
checking for DB_MPOOL_CLEAN in db.h...no
checking for DB_MPOOL_CREATE in db.h...yes
checking for DB_MPOOL_DIRTY in db.h...yes
checking for DB_MPOOL_DISCARD in db.h...yes
checking for DB_MPOOL_LAST in db.h...yes
checking for DB_MPOOL_NEW in db.h...yes
checking for DB_MPOOL_PRIVATE in db.h...no
checking for DB_MULTIVERSION in db.h...yes
checking for DB_MUTEX_PROCESS_ONLY in db.h...yes
checking for DB_NEXT_DUP in db.h...yes
checking for DB_NEXT_NODUP in db.h...yes
checking for DB_NODUPDATA in db.h...yes
checking for DB_NOORDERCHK in db.h...yes
checking for DB_NOSERVER in db.h...yes
checking for DB_NOSERVER_HOME in db.h...yes
checking for DB_NOSERVER_ID in db.h...yes
checking for DB_NOTFOUND in db.h...yes
checking for DB_OLD_VERSION in db.h...yes
checking for DB_ORDERCHKONLY in db.h...yes
checking for DB_OVERWRITE in db.h...yes
checking for DB_POSITION in db.h...yes
checking for DB_PRIVATE in db.h...yes
checking for DB_SYSTEM_MEM in db.h...yes
checking for DB_RMW in db.h...yes
checking for DB_PAD in db.h...no
checking for DB_PREV_DUP in db.h...yes
checking for DB_PREV_NODUP in db.h...yes
checking for DB_PRINTABLE in db.h...yes
checking for DB_PRIORITY_DEFAULT in db.h...yes
checking for DB_PRIORITY_HIGH in db.h...yes
checking for DB_PRIORITY_LOW in db.h...yes
checking for DB_PRIORITY_VERY_HIGH in db.h...yes
checking for DB_QUEUE in db.h...yes
checking for DB_RDONLY in db.h...yes
checking for DB_READ_COMMITTED in db.h...yes
checking for DB_READ_UNCOMMITTED in db.h...yes
checking for DB_RECNO in db.h...yes
checking for DB_RECNUM in db.h...yes
checking for DB_RECORDCOUNT in db.h...no
checking for DB_RECOVER in db.h...yes
checking for DB_RECOVER_FATAL in db.h...yes
checking for DB_REGION_INIT in db.h...yes
checking for DB_RENUMBER in db.h...yes
checking for DB_REPFLAGS_MASK in db.h...no
checking for DB_REPMGR_ACKS_ALL in db.h...yes
checking for DB_REPMGR_ACKS_ALL_PEERS in db.h...yes
checking for DB_REPMGR_ACKS_NONE in db.h...yes
checking for DB_REPMGR_ACKS_ONE in db.h...yes
checking for DB_REPMGR_ACKS_ONE_PEER in db.h...yes
checking for DB_REPMGR_ACKS_QUORUM in db.h...yes
checking for DB_REPMGR_CONNECTED in db.h...yes
checking for DB_REPMGR_DISCONNECTED in db.h...yes
checking for DB_REPMGR_PEER in db.h...yes
checking for DB_REP_ACK_TIMEOUT in db.h...yes
checking for DB_REP_ANYWHERE in db.h...yes
checking for DB_REP_BULKOVF in db.h...yes
checking for DB_REP_CHECKPOINT_DELAY in db.h...yes
checking for DB_REP_CLIENT in db.h...yes
checking for DB_REP_CONF_BULK in db.h...yes
checking for DB_REP_CONF_DELAYCLIENT in db.h...yes
checking for DB_REP_CONF_NOAUTOINIT in db.h...no
checking for DB_REP_CONF_NOWAIT in db.h...yes
checking for DB_REP_CONNECTION_RETRY in db.h...yes
checking for DB_REP_DEFAULT_PRIORITY in db.h...yes
checking for DB_REP_DUPMASTER in db.h...yes
checking for DB_REP_EGENCHG in db.h...no
checking for DB_REP_ELECTION in db.h...yes
checking for DB_REP_ELECTION_RETRY in db.h...yes
checking for DB_REP_ELECTION_TIMEOUT in db.h...yes
checking for DB_REP_FULL_ELECTION in db.h...no
checking for DB_REP_FULL_ELECTION_TIMEOUT in db.h...yes
checking for DB_REP_HANDLE_DEAD in db.h...yes
checking for DB_REP_HOLDELECTION in db.h...yes
checking for DB_REP_IGNORE in db.h...yes
checking for DB_REP_ISPERM in db.h...yes
checking for DB_REP_JOIN_FAILURE in db.h...yes
checking for DB_REP_LEASE_EXPIRED in db.h...yes
checking for DB_REP_LEASE_TIMEOUT in db.h...yes
checking for DB_REP_LOCKOUT in db.h...yes
checking for DB_REP_LOGREADY in db.h...yes
checking for DB_REP_LOGSONLY in db.h...no
checking for DB_REP_MASTER in db.h...yes
checking for DB_REP_NEWMASTER in db.h...yes
checking for DB_REP_NEWSITE in db.h...yes
checking for DB_REP_NOBUFFER in db.h...yes
checking for DB_REP_NOTPERM in db.h...yes
checking for DB_REP_OUTDATED in db.h...no
checking for DB_REP_PAGEDONE in db.h...yes
checking for DB_REP_PERMANENT in db.h...yes
checking for DB_REP_REREQUEST in db.h...yes
checking for DB_REP_UNAVAIL in db.h...yes
checking for DB_RPCCLIENT in db.h...no
checking for DB_RUNRECOVERY in db.h...yes
checking for DB_SALVAGE in db.h...yes
checking for DB_SECONDARY_BAD in db.h...yes
checking for DB_SET in db.h...yes
checking for DB_SET_LOCK_TIMEOUT in db.h...yes
checking for DB_SET_RANGE in db.h...yes
checking for DB_SET_RECNO in db.h...yes
checking for DB_SET_TXN_TIMEOUT in db.h...yes
checking for DB_SNAPSHOT in db.h...yes
checking for DB_STAT_ALL in db.h...yes
checking for DB_STAT_CLEAR in db.h...yes
checking for DB_STAT_SUBSYSTEM in db.h...yes
checking for DB_THREAD in db.h...yes
checking for DB_TRUNCATE in db.h...yes
checking for DB_TXN_ABORT in db.h...yes
checking for DB_TXN_APPLY in db.h...yes
checking for DB_TXN_BACKWARD_ROLL in db.h...yes
checking for DB_TXN_FORWARD_ROLL in db.h...yes
checking for DB_TXN_NOSYNC in db.h...yes
checking for DB_TXN_NOWAIT in db.h...yes
checking for DB_TXN_PRINT in db.h...yes
checking for DB_TXN_SNAPSHOT in db.h...yes
checking for DB_TXN_SYNC in db.h...yes
checking for DB_TXN_WRITE_NOSYNC in db.h...yes
checking for DB_UNKNOWN in db.h...yes
checking for DB_UPGRADE in db.h...yes
checking for DB_USE_ENVIRON in db.h...yes
checking for DB_USE_ENVIRON_ROOT in db.h...yes
checking for DB_VERB_CHKPOINT in db.h...no
checking for DB_VERB_DEADLOCK in db.h...yes
checking for DB_VERB_RECOVERY in db.h...yes
checking for DB_VERB_REPLICATION in db.h...yes
checking for DB_VERB_WAITSFOR in db.h...yes
checking for DB_VERIFY in db.h...yes
checking for DB_PRIORITY_VERY_LOW in db.h...yes
checking for DB_WRITECURSOR in db.h...yes
checking for DB_XA_CREATE in db.h...no
checking for DB_XIDDATASIZE in db.h...no
checking for DB_MULTIPLE_KEY in db.h...yes
checking for DB_REP_CONF_LEASE in db.h...yes
checking for DB_REP_HEARTBEAT_MONITOR in db.h...yes
checking for DB_REP_HEARTBEAT_SEND in db.h...yes
checking for DB_TXN_NOT_DURABLE in db.h...yes
checking for DB_KEY_RANGE in db.h... yes
checking for DB_INFO in db.h... no
checking for DB_SEQUENCE in db.h... yes
checking for DB_LOGC in db.h... yes
checking for DBTYPE in db.h... yes
checking for DB_COMPACT in db.h... yes
checking for DB_HASH_STAT in db.h... yes
checking for DB_HASH_STAT.hash_nkeys in db.h... yes
checking for DB_HASH_STAT.hash_nrecs in db.h... no
checking for DB_HASH_STAT.hash_ndata in db.h... yes
checking for DB_HASH_STAT.hash_nelem in db.h... no
checking for DB_HASH_STAT.hash_pagecnt in db.h... yes
checking for DB_QUEUE_STAT in db.h... yes
checking for DB_QUEUE_STAT.qs_nkeys in db.h... yes
checking for DB_QUEUE_STAT.qs_nrecs in db.h... no
checking for DB_QUEUE_STAT.qs_ndata in db.h... yes
checking for DB_QUEUE_STAT.qs_start in db.h... no
checking for DB_REP_STAT in db.h... yes
checking for DB_REP_STAT.st_bulk_fills in db.h... yes
checking for DB_REP_STAT.st_bulk_overflows in db.h... yes
checking for DB_REP_STAT.st_bulk_records in db.h... yes
checking for DB_REP_STAT.st_bulk_transfers in db.h... yes
checking for DB_REP_STAT.st_client_rerequests in db.h... yes
checking for DB_REP_STAT.st_client_svc_miss in db.h... yes
checking for DB_REP_STAT.st_client_svc_req in db.h... yes
checking for DB_REP_STAT.st_egen in db.h... yes
checking for DB_REP_STAT.st_election_nvotes in db.h... yes
checking for DB_REP_STAT.st_election_sec in db.h... yes
checking for DB_REP_STAT.st_election_usec in db.h... yes
checking for DB_REP_STAT.st_next_pg in db.h... yes
checking for DB_REP_STAT.st_pg_duplicated in db.h... yes
checking for DB_REP_STAT.st_pg_records in db.h... yes
checking for DB_REP_STAT.st_pg_requested in db.h... yes
checking for DB_REP_STAT.st_startup_complete in db.h... yes
checking for DB_REP_STAT.st_waiting_pg in db.h... yes
checking for DBC.c_close in db.h... yes
checking for DBC.c_count in db.h... yes
checking for DBC.c_del in db.h... yes
checking for DBC.c_dup in db.h... yes
checking for DBC.c_get in db.h... yes
checking for DBC.c_pget in db.h... yes
checking for DBC.c_put in db.h... yes
checking for DBC.close in db.h... yes
checking for DBC.count in db.h... yes
checking for DBC.del in db.h... yes
checking for DBC.dup in db.h... yes
checking for DBC.get in db.h... yes
checking for DBC.pget in db.h... yes
checking for DBC.put in db.h... yes
checking for DBC.get_priority in db.h... yes
checking for DB.app_private in db.h... yes
checking for DB.set_h_compare in db.h... yes
checking for DB.set_append_recno in db.h... yes
checking for DB.set_feedback in db.h... yes
checking for DB.set_q_extendsize in db.h... no
checking for DB.set_encrypt in db.h... yes
checking for DB.set_errcall in db.h... yes
checking for DB.get_type in db.h... yes
checking for DB.pget in db.h... yes
checking for DB.fd in db.h... yes
checking for DB.set_priority in db.h... yes
checking for DB.byteswapped in db.h... no
checking for DB.get_bt_minkey in db.h... yes
checking for DB.get_cachesize in db.h... yes
checking for DB.get_dbname in db.h... yes
checking for DB.get_env in db.h... yes
checking for DB.get_h_ffactor in db.h... yes
checking for DB.get_h_nelem in db.h... yes
checking for DB.get_lorder in db.h... yes
checking for DB.get_pagesize in db.h... yes
checking for DB.get_q_extentsize in db.h... yes
checking for DB.get_re_delim in db.h... yes
checking for DB.get_re_len in db.h... yes
checking for DB.get_re_pad in db.h... yes
checking for DB.get_re_source in db.h... yes
checking for DB.get_flags in db.h... yes
checking for DB.get_open_flags in db.h... yes
checking for DB.verify in db.h... yes
checking for DB.truncate in db.h... yes
checking for DB.upgrade in db.h... yes
checking for DB.remove in db.h... yes
checking for DB.rename in db.h... yes
checking for DB.join in db.h... yes
checking for DB.get_byteswapped in db.h... yes
checking for DB.set_cache_priority in db.h... no
checking for DB_GET_TYPE_2... yes
checking for DB.open in db.h... yes
checking for DB_OPEN_7... yes
checking for DB.associate in db.h... yes
checking for DB_ASSOCIATE_TXN... yes
checking for DB_JOIN_FLAG_DBC... yes
checking for DB_GET_BYTESWAPPED_2... yes
checking for DB_ENV.get_cachesize in db.h... yes
checking for DB_ENV.get_data_dirs in db.h... yes
checking for DB_ENV.get_flags in db.h... yes
checking for DB_ENV.get_home in db.h... yes
checking for DB_ENV.get_lg_bsize in db.h... yes
checking for DB_ENV.get_lg_dir in db.h... yes
checking for DB_ENV.get_lg_max in db.h... yes
checking for DB_ENV.get_lg_regionmax in db.h... yes
checking for DB_ENV.get_lk_detect in db.h... yes
checking for DB_ENV.get_lk_max_lockers in db.h... yes
checking for DB_ENV.get_lk_max_locks in db.h... yes
checking for DB_ENV.get_lk_max_objects in db.h... yes
checking for DB_ENV.get_mp_mmapsize in db.h... yes
checking for DB_ENV.get_open_flags in db.h... yes
checking for DB_ENV.get_rep_limit in db.h... no
checking for DB_ENV.get_rep_nsites in db.h... no
checking for DB_ENV.get_shm_key in db.h... yes
checking for DB_ENV.get_tas_spins in db.h... no
checking for DB_ENV.get_tmp_dir in db.h... yes
checking for DB_ENV.get_timeout in db.h... yes
checking for DB_ENV.get_tx_max in db.h... yes
checking for DB_ENV.get_tx_timestamp in db.h... yes
checking for DB_ENV.rep_get_nsites in db.h... yes
checking for DB_ENV.rep_get_priority in db.h... yes
checking for DB_ENV.lg_info in db.h... no
checking for DB_ENV.log_put in db.h... yes
checking for DB_ENV.log_flush in db.h... yes
checking for DB_ENV.log_cursor in db.h... yes
checking for DB_ENV.log_file in db.h... yes
checking for DB_ENV.log_flush in db.h... yes
checking for DB_ENV.set_feedback in db.h... yes
checking for DB_ENV.set_app_dispatch in db.h... yes
checking for DB_ENV.set_rep_transport in db.h... no
checking for DB_ENV.set_timeout in db.h... yes
checking for DB_ENV.set_txn_timeout in db.h... no
checking for DB_ENV.set_lock_timeout in db.h... no
checking for DB_ENV.set_encrypt in db.h... yes
checking for DB_ENV.set_rep_limit in db.h... no
checking for DB_ENV.rep_elect in db.h... yes
checking for DB_ENV.rep_start in db.h... yes
checking for DB_ENV.rep_process_message in db.h... yes
checking for DB_ENV.rep_set_limit in db.h... yes
checking for DB_ENV.set_msgcall in db.h... yes
checking for DB_ENV.set_thread_id in db.h... yes
checking for DB_ENV.set_thread_id_string in db.h... yes
checking for DB_ENV.set_isalive in db.h... yes
checking for DB_ENV.set_shm_key in db.h... yes
checking for DB_ENV.rep_set_nsites in db.h... yes
checking for DB_ENV.rep_set_priority in db.h... yes
checking for DB_ENV.rep_set_config in db.h... yes
checking for DB_ENV.rep_set_timeout in db.h... yes
checking for DB_ENV.rep_set_transport in db.h... yes
checking for DB_ENV.repmgr_set_local_site in db.h... yes
checking for DB_ENV.repmgr_add_remote_site in db.h... yes
checking for DB_ENV.repmgr_set_ack_policy in db.h... yes
checking for DB_ENV.repmgr_set_site_list in db.h... no
checking for DB_ENV.repmgr_start in db.h... yes
checking for DB_ENV.set_intermediate_dir_mode in db.h... yes
checking for DB_ENV.set_event_notify in db.h... yes
checking for DB_ENV.set_cachesize in db.h... yes
checking for DB_ENV.set_region_init in db.h... no
checking for DB_ENV.set_tas_spins in db.h... no
checking for DB_ENV.set_tx_timestamp in db.h... yes
checking for DB_ENV.db_verbose in db.h... no
checking for DB_ENV.set_verbose in db.h... yes
checking for DB_ENV.lk_detect in db.h... yes
checking for DB_ENV.set_lk_detect in db.h... yes
checking for DB_ENV.lk_max in db.h... yes
checking for DB_ENV.set_lk_max in db.h... no
checking for DB_ENV.lk_conflicts in db.h... yes
checking for DB_ENV.set_lk_conflicts in db.h... yes
checking for DB_ENV.set_timeout in db.h... yes
checking for DB_ENV.set_lk_max_locks in db.h... yes
checking for DB_ENV.set_lk_max_lockers in db.h... yes
checking for DB_ENV.lg_max in db.h... no
checking for DB_ENV.set_lk_max_objects in db.h... yes
checking for DB_ENV.set_lg_bsize in db.h... yes
checking for DB_ENV.set_data_dir in db.h... yes
checking for DB_ENV.set_lg_dir in db.h... yes
checking for DB_ENV.set_tmp_dir in db.h... yes
checking for DB_ENV.set_server in db.h... no
checking for DB_ENV.set_rpc_server in db.h... no
checking for DB_ENV.set_flags in db.h... yes
checking for DB_ENV.close in db.h... yes
checking for DB_ENV.set_func_sleep in db.h... no
checking for DB_ENV.set_func_yield in db.h... no
checking for DB_ENV.set_alloc in db.h... yes
checking for DB_ENV.set_errcall in db.h... yes
checking for DB_ENV.lsn_reset in db.h... yes
checking for DB_ENV.fileid_reset in db.h... yes
checking for DB_ENV.failchk in db.h... yes
checking for DB_ENV.rep_sync in db.h... yes
checking for DB_ENV.rep_stat in db.h... yes
checking for DB_ENV.log_set_config in db.h... yes
checking for DB_ENV.fidp in db.h... no
checking for DB_ENV.rep_set_clockskew in db.h... yes
checking for DB_ENV.rep_set_request in db.h... yes
checking for DB_ENV.open in db.h... yes
checking for ENV_OPEN_DB_CONFIG... no
checking for ENV_REMOVE_4... no
checking for DB_ENV.log_stat in db.h... yes
checking for DB_ENV.log_archive in db.h... yes
checking for DB_ENV.log_register in db.h... no
checking for DB_ENV.log_unregister in db.h... no
checking for DB_CURSOR_4... yes
checking for DB_ENV_REP_ELECT_7... no
checking for DB_ENV_REP_ELECT_5... no
checking for DB_ENV_REP_PROCESS_MESSAGE_5... yes
checking for DB_LOG_STAT.st_refcnt in db.h... no
checking for DB_LOG_STAT.st_lg_bsize in db.h... yes
checking for DB_LOG_STAT.st_lg_size in db.h... yes
checking for DB_LOG_STAT.st_lg_max in db.h... no
checking for DB_LOG_STAT.st_wcount_fill in db.h... yes
checking for DB_LOG_STAT.st_disk_file in db.h... yes
checking for DB_LOG_STAT.st_disk_offset in db.h... yes
checking for DB_LOG_STAT.st_flushcommit in db.h... no
checking for DB_LOG_STAT.st_maxcommitperflush in db.h... yes
checking for DB_LOG_STAT.st_mincommitperflush in db.h... yes
checking for DB_BTREE_STAT.bt_nkeys in db.h... yes
checking for DB_BTREE_STAT.bt_nrecs in db.h... no
checking for DB_BTREE_STAT.bt_ndata in db.h... yes
checking for DB_BTREE_STAT.bt_pagecnt in db.h... yes
checking for DB_STAT_4... yes
checking for DB_CURSOR_4... yes
checking for DB_ENV.lock_id_free in db.h... yes
checking for DB_ENV.lock_id in db.h... yes
checking for DB_ENV.lk_info in db.h... no
checking for DB_ENV.lock_detect in db.h... yes
checking for DB_ENV.lock_stat in db.h... yes
checking for DB_ENV.lock_get in db.h... yes
checking for DB_ENV.lock_vec in db.h... yes
checking for DB_ENV.lock_put in db.h... yes
checking for DB_LOCK_STAT.st_id in db.h... yes
checking for DB_LOCK_STAT.st_lastid in db.h... no
checking for DB_LOCK_STAT.st_lock_nowait in db.h... yes
checking for DB_LOCK_STAT.st_lock_wait in db.h... yes
checking for DB_LOCK_STAT.st_nnowaits in db.h... no
checking for DB_LOCK_STAT.st_nconflicts in db.h... no
checking for DB_LOCK_STAT.st_objs_nowait in db.h... yes
checking for DB_LOCK_STAT.st_objs_wait in db.h... yes
checking for DB_LOCK_STAT.st_lockers_nowait in db.h... yes
checking for DB_LOCK_STAT.st_lockers_wait in db.h... yes
checking for DB_LOCK_STAT.st_locks_nowait in db.h... no
checking for DB_LOCK_STAT.st_locks_wait in db.h... no
checking for DB_LOCKREQ.timeout in db.h... yes
checking for DB_TXN.abort in db.h... yes
checking for DB_TXN.commit in db.h... yes
checking for DB_TXN.id in db.h... yes
checking for DB_TXN.prepare in db.h... yes
checking for DB_TXN.discard in db.h... yes
checking for DB_TXN.set_timeout in db.h... yes
checking for DB_TXN.set_name in db.h... yes
checking for DB_ENV.tx_info in db.h... no
checking for DB_ENV.txn_begin in db.h... yes
checking for DB_ENV.txn_checkpoint in db.h... yes
checking for DB_ENV.txn_recover in db.h... yes
checking for DB_ENV.txn_stat in db.h... yes
checking for DB_ENV.dbremove in db.h... yes
checking for DB_ENV.dbrename in db.h... yes
checking for DB_ENV.set_tx_max in db.h... yes
checking for DB_TXN_STAT.st_maxnactive in db.h... yes
checking for DB_TXN_STAT.st_regsize in db.h... yes
checking for DB_TXN_STAT.st_region_wait in db.h... yes
checking for DB_TXN_STAT.st_region_nowait in db.h... yes
checking for DB_TXN_STAT.st_last_ckp in db.h... yes
checking for DB_TXN_STAT.st_pending_ckp in db.h... no
checking for DB_TXN_STAT.st_nrestores in db.h... yes
checking for DB_TXN_ACTIVE.tid in db.h... yes
checking for DB_TXN_ACTIVE.name in db.h... yes
checking for DB_TXN_ACTIVE.parentid in db.h... yes
checking for ENV_REP_TRANSPORT_6... yes
checking for DB_ENV_REP_PROCESS_MESSAGE_ENVID... yes
creating Makefile
extconf.rb: Leaving directory `src'

The last few lines of my result after running line "ruby extconf.rb --with-db-dir=/usr/local/Cellar/berkeley-db/5.3.15"

checking for db_version() in -ldb... 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.
extconf.rb:109: libdb not found (RuntimeError)
from extconf.rb:87:in `catch'
from extconf.rb:87

Could it be that the berkeley db hasn't been installed correctly? or maybe the version?

It could very well be that Berkeley DB isn't installed properly. Can you confirm that the Homebrew install is working?

Also check that the version is correct by ls /usr/local/Cellar/berkeley-db/.

It is working. Berkeley-db is installed and the lib/ folder contains the libdb files.

@lramach I had the same error messages as you, and it was caused by my system defaulting to ruby 1.8.7, when I tried with 1.9.3 it worked fine.

Thanks that helped! I was able to install ruby-bdb with ruby version 1.9.2.
However, while trying to install the wordnet gem and setting up the database with 'ruby convertdb.rb' I am getting the following error:
.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Permission denied - /Library/Ruby/Gems/1.8/gems/wordnet-0.0.5/ruby-wordnet (Errno::EACCES)
I downloaded and installed WordNet-3.0 in a folder that did not require any permission.
Any idea how I can fix this? Thanks again for all the help!

Did you previously install the WordNet gem as a superuser? Perhaps try an uninstall of WordNet and then try to re-install.

Thanks for that suggestion!
I tried 'sudo ruby convert.rb' and it worked!

I completed all the steps, but when I run

require 'rubygems'
require 'wordnet'
lex = WordNet::Lexicon.new
I get the following error:

TypeError: can't convert Symbol into Integer
from /ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:93:in %'
from /ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:93:in
initialize'
from (irb):3:in new'
from (irb):3
from /ruby-1.9.2-p290/bin/irb:16:in
'

Did anyone encounter this error?

I finally got it working, after making a copy of the ruby-wordnet directory in the '..rvm/rubies/ruby-1.9.2-p290/share/' directory and using 'lex = WordNet::Lexicon.new(WordNet::Lexicon::DEFAULT_DB_ENV, :044)' to create the lexicon!

Thanks for all the help!

Great! Glad to hear you got it working.

I just realized that the 'ruby convertdb.rb' had resulted in a segmentation fault.

convertdb.rb: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]

-- control frame ----------

c:0001 p:0000 s:0002 b:0002 l:0006d8 d:0006d8 TOP

-- C level backtrace information -------------------------------------------

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Although wordnet is working fine for some cases, it results in segmentation faults while trying to lookup_synset. I looked around but couldn't find a solution to this. Did anyone face a similar issue? Any help would be appreciated! thanks!

For me this segmentation fault occurred on exit - so the convertdb.rb script executed 'correctly'

Same here. However, when I run my code for looking up synsets (lookup_synsets), it throws me the following error:

.rvm/gems/ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/synset.rb:309:in initialize': uninitialized constant WordNet::Synset::Sync (NameError)
from .rvm/gems/ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:233:in
new'
from .rvm/gems/ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:233:in block in lookup_synsets_by_key'
from .rvm/gems/ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:227:in
each'
from .rvm/gems/ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:227:in lookup_synsets_by_key'
from .rvm/gems/ruby-1.9.2-p290/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:214:in
lookup_synsets'
from /Aptana Studio 3 Workspace/NLP_Test_0.1/wordnetBasedSimilarity.rb:43:in compareStrings'
from /Aptana Studio 3 Workspace/NLP_Test_0.1/wordnetBasedSimilarity.rb:404:in
'
/Aptana Studio 3 Workspace/NLP_Test_0.1/wordnetBasedSimilarity.rb: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]

-- control frame ----------

c:0001 p:0000 s:0002 b:0002 l:000308 d:000308 TOP

-- C level backtrace information -------------------------------------------

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.

Bug reports are welcome.

Edit: The lookup code works fine while running it from the irb console.

try finishing your code by closing the WordNet::Lexicon connection (e.g. for me this is lex.close)

But you would add the lex.close after the lookup_synsets() line, correct?
My code is failing on the line containing the lookup!

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.