Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDBM in Standard Lib missing or is it just me?

Tags:

ruby

GDBM looks interesting, a kind of persistent Hash or a key-value store. However the example code does not run:

require 'gdbm'

results in this error:

cannot load such file -- gdbm (LoadError)

I'm using Ruby 1.9.3 on Ubuntu. Is the documentation wrong or is something wrong with my Ruby install?

like image 690
steenslag Avatar asked Oct 25 '25 04:10

steenslag


1 Answers

GDBM is a library that provides an API to the GNU Database Library, which you might not have installed. Ruby Standard Library documentation advises it's available only if the underlying library is available on your system. (No point offering a library that doesn't connect to anything!) Install libgdbm3 with apt-get, confirm you have your library ('locate libgdbm' e.g.), and reinstall/update your ruby 1.9 to incorporate the library into your ruby.

like image 81
LazyMonkey Avatar answered Oct 26 '25 23:10

LazyMonkey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!