# Dbm on RedHat

**URL:** <https://www.ruby-forum.com/t/dbm-on-redhat/168601>\
**Category:** Ruby\
**Created:** [May 22, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/dbm-on-redhat/168601 "2009-05-22T19:23:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Brodbeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@David\_Brodbeck](https://www.ruby-forum.com/u/David_Brodbeck)\
**Post date:** [May 22, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/dbm-on-redhat/168601/1 "2009-05-22T19:23:13Z")

</div>

A user I support is trying to use the dbm module that’s part of Ruby’s  
standard library, but it doesn’t seem to be installed. We’re running  
RedHat Enterprise Linux 5.3, with Ruby 1.8.5 installed via RPM from  
RedHat’s repository. We also have Ruby Gems configured. Trying to  
require dbm gives this error:

brodbd@patas:~$ irb  
irb(main):001:0\> require “dbm”  
LoadError: no such file to load – dbm  
from /opt/ruby-gems/lib/site\_ruby/1.8/rubygems/custom\_require.rb:  
27:in `gem_original_require' from /opt/ruby-gems/lib/site_ruby/1.8/rubygems/custom_require.rb: 27:in`require’  
from (irb):1  
irb(main):002:0\>

I can’t figure out what additional packages I need to install to make  
dbm available, and I’m hoping someone here can help.

I apologize if this is a dumb question, but I’m not terribly familiar  
with Ruby, and my attempts to find an answer via Google haven’t been  
successful.

–

David Brodbeck  
System A., Linguistics  
University of Washington

---

<div class="post-metadata">

**Author:** ![David\_Brodbeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@David\_Brodbeck](https://www.ruby-forum.com/u/David_Brodbeck)\
**Post date:** [May 26, 2009, 9:03pm UTC](https://www.ruby-forum.com/t/dbm-on-redhat/168601/2 "2009-05-26T21:03:23Z")

</div>

On May 22, 2009, at 10:21 AM, David Brodbeck wrote:

> 27:in `gem\_original\_require’  
> haven’t been successful.  
> Experimenting a bit more, it doesn’t seem to be related to the  
> environment changes I made to install Ruby Gems, either:

brodbd@patas:~$ unset RUBYOPT ; unset RUBYLIB ; irb  
irb(main):001:0\> require ‘dbm’  
LoadError: no such file to load – dbm  
from (irb):1:in `require’  
from (irb):1

–

David Brodbeck  
System A., Linguistics  
University of Washington

---

<div class="post-metadata">

**Author:** ![David\_Brodbeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@David\_Brodbeck](https://www.ruby-forum.com/u/David_Brodbeck)\
**Post date:** [May 26, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/dbm-on-redhat/168601/3 "2009-05-26T22:46:04Z")

</div>

Oops, should have said

---

<div class="post-metadata">

**Author:** ![David\_Brodbeck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@David\_Brodbeck](https://www.ruby-forum.com/u/David_Brodbeck)\
**Post date:** [May 26, 2009, 10:41pm UTC](https://www.ruby-forum.com/t/dbm-on-redhat/168601/4 "2009-05-26T22:41:23Z")

</div>

I’ve got a bunch of CentOS 5 boxes here, 5.0 through 5.3. None of  
them include dbm by default, but they all include gdbm. If you don’t  
need “real” dbm, gdbm is probably better anyway ( personal opinion 🙂

If you want to be really really compatible everywhere, you can use  
sdbm, which is pure ruby, or at least included with the core ruby  
code.

Libraries dbm gdbm and sdbm all use the same calls (prettymuch), so  
you can write your code to use whichever one it can find, as long as  
the lack compatibility is something you can live with.

For speed purposes, dbm and gdbm seem the same to me, and sdbm is rather  
slow.

The big upside of gdbm is that the database files it creates aren’t as  
dependent on the version of the library: newer versions can read older  
databases. With a dbm database, you need that exact same version to  
read or modify the library, so it’s harder to move it from machine to  
machine.

–Kyle
