# BDB::Fatal error from WordNet

**URL:** <https://www.ruby-forum.com/t/bdb-fatal-error-from-wordnet/177562>\
**Category:** Ruby\
**Created:** [October 20, 2009, 9:26am UTC](https://www.ruby-forum.com/t/bdb-fatal-error-from-wordnet/177562 "2009-10-20T09:26:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [October 20, 2009, 9:26am UTC](https://www.ruby-forum.com/t/bdb-fatal-error-from-wordnet/177562/1 "2009-10-20T09:26:28Z")

</div>

I’ve got a ruby script that calls Ruby-WordNet which in turns calls DBD.  
I’m getting an error from DBD that looks like this (there’s some debug  
output from wordnet’s lexicon.rb that I turned on):

$ sh run\_everything.sh  
Tue Oct 20 03:19:59 EDT 2009  
------ now running determine\_features.rb  
Mode is: 71571  
Mode is: 0444  
Using readonly flags  
Env flags are: 10000000000000000000, dbflags are 0  
EnvOptions: {:set\_timeout=\>50, :set\_lk\_detect=\>1, :set\_verbose=\>true}  
/usr/local/lib/site\_ruby/1.8/wordnet/lexicon.rb:121:in `initialize': Error while opening Ruby-WordNet data files: /usr/share/ruby-wordnet: Invalid argument (BDB::Fatal) from /usr/local/lib/site_ruby/1.8/wordnet/lexicon.rb:121:in`new’  
from /usr/local/lib/site\_ruby/1.8/wordnet/lexicon.rb:121:in  
`initialize' from ./encoder_tools.rb:145:in`new’  
from ./encoder\_tools.rb:145:in `initialize' from ./determine_features.rb:32:in`new’  
from ./determine\_features.rb:32

The actual line in lexicon.rb that causes this error is:

@env = BDB::Env::new( dbenv, envflags, EnvOptions )

What I can’t figure out is which argument here is invalid, or otherwise  
what’s going wrong.

Possibly useful info: I’ve successfully built and installed bdb-0.6.5  
from source- that’s the one I want to be running. However I also have  
the libdb4.6-ruby1.8 package installed on the same machine (and  
according to apt-cache showpkg it’s using 0.6.2-0ubuntu1). So I’m  
unclear which actual lib I’m using when this error happens.

Does anyone have any ideas about how to get past this?

Thanks in advance for any and all advice.

Cheers,  
-Jason

---

<div class="post-metadata">

**Author:** ![jfoxny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@jfoxny](https://www.ruby-forum.com/u/jfoxny)\
**Post date:** [October 25, 2009, 4:21am UTC](https://www.ruby-forum.com/t/bdb-fatal-error-from-wordnet/177562/2 "2009-10-25T04:21:23Z")

</div>

On Oct 20, 2009, at 12:26 AM, Jason Fr wrote:

> Using readonly flags  
> from ./encoder\_tools.rb:145:in `initialize' from ./determine_features.rb:32:in`new’  
> from ./determine\_features.rb:32
> 
> The actual line in lexicon.rb that causes this error is:
> 
> @env = BDB::Env::new( dbenv, envflags, EnvOptions )
> 
> What I can’t figure out is which argument here is invalid, or  
> otherwise  
> what’s going wrong.

This is happening because the first argument to BDB::Env.new is a  
database directory, and you’ve given it a directory without a  
database. You’ll need to build the Wordnet database using the included  
‘convertdb.rb’ script and copy the resulting directory to /usr/share/  
ruby-wordnet, then you should be set.
