From: david on
I've been scripting in Ruby (and Rails) for about two years now, but
have never gotten into the internals of the module/gem side. I've
created a Ruby script using SQLite3 which works well for small data
sets but has a performance issue when dealing with a large amount of
data. I'm hoping to try the Berkeley DB.

To start, the environment is the following.

Windows XP
Berkeley DB 4.8.24
ruby 1.8.6-27 (http://rubyinstaller.org)
devkit-3.4.5r3-20090411 (http://rubyinstaller.org/addons.html)
bdb-0.6.5

When I execute the extconf.rb script I receive the below output. I'm
assuming it is not able to locate the Berkeley libraries. I have added
the the Berkeley_Install/bin and Berkeley_Install/lib to the PATH with
no luck.

Just wondering if anyone has seen this or might have some ideas for
me?


C:\bdb-0.6.5>dir
Volume in drive C has no label.
Volume Serial Number is CCDF-9304

Directory of C:\bdb-0.6.5

11/09/2009 08:39 AM <DIR> .
11/09/2009 08:39 AM <DIR> ..
02/15/2005 12:06 PM 4,715 bdb.html
02/15/2005 12:06 PM 3,941 bdb.rd
11/08/2009 09:08 PM <DIR> bdbxml1
11/08/2009 09:08 PM <DIR> bdbxml2
06/14/2008 11:23 AM 7,096 Changes
11/08/2009 09:08 PM <DIR> docs
11/08/2009 09:08 PM <DIR> examples
04/26/2005 08:49 AM 1,762 extconf.rb
11/09/2009 08:45 AM 1,710 Makefile
06/26/2008 07:27 AM 1,350 README.en
11/09/2009 08:45 AM <DIR> src
11/08/2009 09:08 PM <DIR> tests
11/08/2009 09:08 PM <DIR> tmp
11/08/2009 09:08 PM <DIR> util
6 File(s) 20,574 bytes
10 Dir(s) 12,698,308,608 bytes free

C:\bdb-0.6.5>ruby extconf.rb
extconf.rb: Entering directory `src'
checking for db_version() in db-4.7.lib... no
checking for db_version_4007() in db-4.7.lib... no
checking for db_version() in db47.lib... no
checking for db_version_4007() in db47.lib... no
checking for db_version() in db-4.6.lib... no
checking for db_version_4006() in db-4.6.lib... no
checking for db_version() in db46.lib... no
checking for db_version_4006() in db46.lib... no
checking for db_version() in db-4.5.lib... no
checking for db_version_4005() in db-4.5.lib... no
checking for db_version() in db45.lib... no
checking for db_version_4005() in db45.lib... no
checking for db_version() in db-4.4.lib... no
checking for db_version_4004() in db-4.4.lib... no
checking for db_version() in db44.lib... no
checking for db_version_4004() in db44.lib... no
checking for db_version() in db-4.3.lib... no
checking for db_version_4003() in db-4.3.lib... no
checking for db_version() in db43.lib... no
checking for db_version_4003() in db43.lib... no
checking for db_version() in db-4.2.lib... no
checking for db_version_4002() in db-4.2.lib... no
checking for db_version() in db42.lib... no
checking for db_version_4002() in db42.lib... no
checking for db_version() in db-4.1.lib... no
checking for db_version_4001() in db-4.1.lib... no
checking for db_version() in db41.lib... no
checking for db_version_4001() in db41.lib... no
checking for db_version() in db-4.0.lib... no
checking for db_version_4000() in db-4.0.lib... no
checking for db_version() in db-4.lib... no
checking for db_version_4000() in db-4.lib... no
checking for db_version() in db40.lib... no
checking for db_version_4000() in db40.lib... no
checking for db_version() in db4.lib... no
checking for db_version_4000() in db4.lib... no
checking for db_version() in db3.lib... no
checking for db_version_3000() in db3.lib... no
checking for db_version() in db2.lib... no
checking for db_version_2000() in db2.lib... no
checking for db_version() in db.lib... no
Trying with -lpthread
checking for db_version() in db-4.7.lib... no
checking for db_version_4007() in db-4.7.lib... no
checking for db_version() in db47.lib... no
checking for db_version_4007() in db47.lib... no
checking for db_version() in db-4.6.lib... no
checking for db_version_4006() in db-4.6.lib... no
checking for db_version() in db46.lib... no
checking for db_version_4006() in db46.lib... no
checking for db_version() in db-4.5.lib... no
checking for db_version_4005() in db-4.5.lib... no
checking for db_version() in db45.lib... no
checking for db_version_4005() in db45.lib... no
checking for db_version() in db-4.4.lib... no
checking for db_version_4004() in db-4.4.lib... no
checking for db_version() in db44.lib... no
checking for db_version_4004() in db44.lib... no
checking for db_version() in db-4.3.lib... no
checking for db_version_4003() in db-4.3.lib... no
checking for db_version() in db43.lib... no
checking for db_version_4003() in db43.lib... no
checking for db_version() in db-4.2.lib... no
checking for db_version_4002() in db-4.2.lib... no
checking for db_version() in db42.lib... no
checking for db_version_4002() in db42.lib... no
checking for db_version() in db-4.1.lib... no
checking for db_version_4001() in db-4.1.lib... no
checking for db_version() in db41.lib... no
checking for db_version_4001() in db41.lib... no
checking for db_version() in db-4.0.lib... no
checking for db_version_4000() in db-4.0.lib... no
checking for db_version() in db-4.lib... no
checking for db_version_4000() in db-4.lib... no
checking for db_version() in db40.lib... no
checking for db_version_4000() in db40.lib... no
checking for db_version() in db4.lib... no
checking for db_version_4000() in db4.lib... no
checking for db_version() in db3.lib... no
checking for db_version_3000() in db3.lib... no
checking for db_version() in db2.lib... no
checking for db_version_2000() in db2.lib... no
checking for db_version() in db.lib... 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby/bin/ruby
--enable-unknown
--disable-unknown
--with-db-dir
--without-db-dir
--with-db-include
--without-db-include=${db-dir}/include
--with-db-lib
--without-db-lib=${db-dir}/lib
--enable-thread
--disable-thread
--with-db-uniquename
--without-db-uniquename
--with-db-pthread
--without-db-pthread
--with-db-version
--without-db-version
--with-db-4.7lib
--without-db-4.7lib
--with-db-4.7lib
--without-db-4.7lib
--with-db47lib
--without-db47lib
--with-db47lib
--without-db47lib
--with-db-4.6lib
--without-db-4.6lib
--with-db-4.6lib
--without-db-4.6lib
--with-db46lib
--without-db46lib
--with-db46lib
--without-db46lib
--with-db-4.5lib
--without-db-4.5lib
--with-db-4.5lib
--without-db-4.5lib
--with-db45lib
--without-db45lib
--with-db45lib
--without-db45lib
--with-db-4.4lib
--without-db-4.4lib
--with-db-4.4lib
--without-db-4.4lib
--with-db44lib
--without-db44lib
--with-db44lib
--without-db44lib
--with-db-4.3lib
--without-db-4.3lib
--with-db-4.3lib
--without-db-4.3lib
--with-db43lib
--without-db43lib
--with-db43lib
--without-db43lib
--with-db-4.2lib
--without-db-4.2lib
--with-db-4.2lib
--without-db-4.2lib
--with-db42lib
--without-db42lib
--with-db42lib
--without-db42lib
--with-db-4.1lib
--without-db-4.1lib
--with-db-4.1lib
--without-db-4.1lib
--with-db41lib
--without-db41lib
--with-db41lib
--without-db41lib
--with-db-4.0lib
--without-db-4.0lib
--with-db-4.0lib
--without-db-4.0lib
--with-db-4lib
--without-db-4lib
--with-db-4lib
--without-db-4lib
--with-db40lib
--without-db40lib
--with-db40lib
--without-db40lib
--with-db4lib
--without-db4lib
--with-db4lib
--without-db4lib
--with-db3lib
--without-db3lib
--with-db3lib
--without-db3lib
--with-db2lib
--without-db2lib
--with-db2lib
--without-db2lib
--with-dblib
--without-dblib
--with-db-4.7lib
--without-db-4.7lib
--with-db-4.7lib
--without-db-4.7lib
--with-db47lib
--without-db47lib
--with-db47lib
--without-db47lib
--with-db-4.6lib
--without-db-4.6lib
--with-db-4.6lib
--without-db-4.6lib
--with-db46lib
--without-db46lib
--with-db46lib
--without-db46lib
--with-db-4.5lib
--without-db-4.5lib
--with-db-4.5lib
--without-db-4.5lib
--with-db45lib
--without-db45lib
--with-db45lib
--without-db45lib
--with-db-4.4lib
--without-db-4.4lib
--with-db-4.4lib
--without-db-4.4lib
--with-db44lib
--without-db44lib
--with-db44lib
--without-db44lib
--with-db-4.3lib
--without-db-4.3lib
--with-db-4.3lib
--without-db-4.3lib
--with-db43lib
--without-db43lib
--with-db43lib
--without-db43lib
--with-db-4.2lib
--without-db-4.2lib
--with-db-4.2lib
--without-db-4.2lib
--with-db42lib
--without-db42lib
--with-db42lib
--without-db42lib
--with-db-4.1lib
--without-db-4.1lib
--with-db-4.1lib
--without-db-4.1lib
--with-db41lib
--without-db41lib
--with-db41lib
--without-db41lib
--with-db-4.0lib
--without-db-4.0lib
--with-db-4.0lib
--without-db-4.0lib
--with-db-4lib
--without-db-4lib
--with-db-4lib
--without-db-4lib
--with-db40lib
--without-db40lib
--with-db40lib
--without-db40lib
--with-db4lib
--without-db4lib
--with-db4lib
--without-db4lib
--with-db3lib
--without-db3lib
--with-db3lib
--without-db3lib
--with-db2lib
--without-db2lib
--with-db2lib
--without-db2lib
--with-dblib
--without-dblib
extconf.rb:90: libdb not found (RuntimeError)
from extconf.rb:69:in `catch'
from extconf.rb:69
extconf.rb: Leaving directory `src'

C:\bdb-0.6.5>


Thanks for your help and time,
Dave
From: Luis Lavena on
On Nov 9, 11:45 am, david <davidho...(a)gmail.com> wrote:
> I've been scripting in Ruby (and Rails) for about two years now, but
> have never gotten into the internals of the module/gem side. I've
> created a Ruby script using SQLite3 which works well for small data
> sets but has a performance issue when dealing with a large amount of
> data. I'm hoping to try the Berkeley DB.
>
> To start, the environment is the following.
>
> Windows XP
> Berkeley DB 4.8.24
> ruby  1.8.6-27 (http://rubyinstaller.org)
> devkit-3.4.5r3-20090411 (http://rubyinstaller.org/addons.html)
> bdb-0.6.5
>

That will not work.

DevKit has been prepared to work with newer RubyInstaller releases,
not the old One-Click ones. That is because One-Click has been
compiled with VC6 and RubyInstaller with GCC, Ruby needs to use the
same compiler.

Using the correct version of Ruby with the DevKit will allow you use --
with-db-dir option pointing to the root of the compiled BDB libraries
(which seems you didn't extract or installed).

So, first:

* Get the proper Ruby and DevKit
* Get BDB binaries and development dependencies
* Unpack them in a directory you remember
* Unpack the bdb extension
* Proceed with extconf and the proper compilation options.

HTH,
--
Luis Lavena
From: david on
On Nov 9, 2:37 pm, Luis Lavena <luislav...(a)gmail.com> wrote:
> On Nov 9, 11:45 am, david <davidho...(a)gmail.com> wrote:
>
> > I've been scripting in Ruby (and Rails) for about two years now, but
> > have never gotten into the internals of the module/gem side. I've
> > created a Ruby script using SQLite3 which works well for small data
> > sets but has a performance issue when dealing with a large amount of
> > data. I'm hoping to try theBerkeleyDB.
>
> > To start, the environment is the following.
>
> > Windows XP
> >BerkeleyDB4.8.24
> > ruby  1.8.6-27 (http://rubyinstaller.org)
> > devkit-3.4.5r3-20090411 (http://rubyinstaller.org/addons.html)
> > bdb-0.6.5
>
> That will not work.
>
> DevKit has been prepared to work with newer RubyInstaller releases,
> not the old One-Click ones. That is because One-Click has been
> compiled with VC6 and RubyInstaller with GCC, Ruby needs to use the
> same compiler.
>
> Using the correct version of Ruby with the DevKit will allow you use --
> with-db-dir option pointing to the root of the compiled BDB libraries
> (which seems you didn't extract or installed).
>
> So, first:
>
> * Get the proper Ruby and DevKit
> * Get BDB binaries and development dependencies
> * Unpack them in a directory you remember
> * Unpack the bdb extension
> * Proceed with extconf and the proper compilation options.
>
> HTH,
> --
> Luis Lavena

Thanks a lot Luis! Giving it a try. Will post results.

Dave
From: david on
On Nov 10, 11:25 am, david <davidho...(a)gmail.com> wrote:
> On Nov 9, 2:37 pm, Luis Lavena <luislav...(a)gmail.com> wrote:
>
>
>
> > On Nov 9, 11:45 am, david <davidho...(a)gmail.com> wrote:
>
> > > I've been scripting in Ruby (and Rails) for about two years now, but
> > > have never gotten into the internals of the module/gem side. I've
> > > created a Ruby script using SQLite3 which works well for small data
> > > sets but has a performance issue when dealing with a large amount of
> > > data. I'm hoping to try theBerkeleyDB.
>
> > > To start, the environment is the following.
>
> > > Windows XP
> > >BerkeleyDB4.8.24
> > > ruby  1.8.6-27 (http://rubyinstaller.org)
> > > devkit-3.4.5r3-20090411 (http://rubyinstaller.org/addons.html)
> > > bdb-0.6.5
>
> > That will not work.
>
> > DevKit has been prepared to work with newer RubyInstaller releases,
> > not the old One-Click ones. That is because One-Click has been
> > compiled with VC6 and RubyInstaller with GCC, Ruby needs to use the
> > same compiler.
>
> > Using the correct version of Ruby with the DevKit will allow you use --
> > with-db-dir option pointing to the root of the compiled BDB libraries
> > (which seems you didn't extract or installed).
>
> > So, first:
>
> > * Get the proper Ruby and DevKit
> > * Get BDB binaries and development dependencies
> > * Unpack them in a directory you remember
> > * Unpack the bdb extension
> > * Proceed with extconf and the proper compilation options.
>
> > HTH,
> > --
> > Luis Lavena
>
> Thanks  a lot Luis! Giving it a try. Will post results.
>
> Dave

Still working on it. I have installed Ruby 1.9.1 using the ZIP as
opposed to the one-click installer. I also pulled down all the DLL
file and copied them to the RubyHome\bin. I was able to install all
required gems using gem. I then moved on to unpacking the devkit and
moving the devkitHome/bin files to RubyHome/bin and moving the
devkitHome to the RubyHome (not sure if I need to something more
here). Attempted to install the DBD extension. Different errors
produces, but seems like progress.

C:\bdb-0.6.5>ruby extconf.rb --with-db-dir=C:\db-4.8.24 --with-db-
lib=C:\db-4.8.24\lib --with-db-include=C:\db-4.8.24\include
extconf.rb: Entering directory `src'
checking for db_version() in db-4.7.lib... *** 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=C:/ruby-1.9.1/bin/ruby
--enable-unknown
--disable-unknown
--with-db-dir
--with-db-include=${db-dir}/include
--with-db-lib=${db-dir}/lib
--enable-thread
--disable-thread
--with-db-uniquename
--without-db-uniquename
--with-db-pthread
--without-db-pthread
--with-db-version
--without-db-version
--with-db-4.7lib
--without-db-4.7lib
C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:362:in `try_do': The complier
failed to generate an executable
file. (RuntimeError)
You have to install development tools first.
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:415:in `try_link0'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:419:in `try_link'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:527:in `try_func'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:723:in `block in
have_library'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:668:in `block in
checking_for'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:274:in `block (2
levels) in postpone'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:248:in `open'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:274:in `block in
postpone'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:248:in `open'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:270:in `postpone'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:667:in
`checking_for'
from C:/ruby-1.9.1/lib/ruby/1.9.1/mkmf.rb:718:in
`have_library'
from extconf.rb:75:in `block (3 levels) in <main>'
from extconf.rb:72:in `each'
from extconf.rb:72:in `block (2 levels) in <main>'
from extconf.rb:71:in `loop'
from extconf.rb:71:in `block in <main>'
from extconf.rb:69:in `catch'
from extconf.rb:69:in `<main>'
extconf.rb: Leaving directory `src'

C:\bdb-0.6.5>


I'm not sure what it means "You have to install development tools
first." as I have no idea how it works. I have a funny feeling the
devkit is not plugged in properly. I will continue to research.


Thanks,
Dave
From: Luis Lavena on
On Nov 10, 6:38 pm, david <davidho...(a)gmail.com> wrote:
> [...]
>
> Still working on it. I have installed Ruby 1.9.1 using the ZIP as
> opposed to the one-click installer. I also pulled down all the DLL
> file and copied them to the RubyHome\bin. I was able to install all
> required gems using gem. I then moved on to unpacking the devkit and
> moving the devkitHome/bin files to RubyHome/bin and moving the
> devkitHome to the RubyHome (not sure if I need to something more
> here). Attempted to install the DBD extension. Different errors
> produces, but seems like progress.
>

Well, no, you will not reach progress because you're using VC6-build
of Ruby instead of MinGW, please keep reading...

> C:\bdb-0.6.5>ruby extconf.rb --with-db-dir=C:\db-4.8.24 --with-db-
> lib=C:\db-4.8.24\lib --with-db-include=C:\db-4.8.24\include
> extconf.rb: Entering directory `src'
> [...]
>
> C:\bdb-0.6.5>
>
> I'm not sure what it means "You have to install development tools
> first." as I have no idea how it works. I have a funny feeling the
> devkit is not plugged in properly. I will continue to research.
>

You still are not following.

You're using ZIp files, or One-Click Installer, which are compiled
with VC6. Unless you have VC6 in your system, nothing will work.

Please, install RubyInstaller package (RC1 is the latest stable one):

http://rubyforge.org/frs/?group_id=167&release_id=41267

After install Development Kit on top of it (use 7-Zip to unpack it)

Then you will be able to compile the extension.

The Zip package at Ruby-lang, as you noticed, is incomplete, there is
a clear note in the download page about it:

"Please note that some of the above binaries will require manual
download and installation of additional components detailed on this
page. Please ensure you’ve followed/performed these steps prior
reporting a bug."

Please refer to our FAQ page in the wiki for RubyInstaller:

http://wiki.github.com/oneclick/rubyinstaller/faq

--
Luis Lavena