# ruby-bdb



## talsamon (Aug 22, 2014)

*F*ails to compile (FreeBSD-9.3-RELEASE):

```
extconf.rb: Entering directory `src'
extconf.rb:48: Use RbConfig instead of obsolete and deprecated Config.
checking for db_version() in -ldb-4.8... *** 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.
.....
/usr/local/lib/ruby/1.9/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /usr/local/lib/ruby/1.9/mkmf.rb:461:in `try_link0'
	from /usr/local/lib/ruby/1.9/mkmf.rb:476:in `try_link'
	from /usr/local/lib/ruby/1.9/mkmf.rb:619:in `try_func'
	from /usr/local/lib/ruby/1.9/mkmf.rb:845:in `block in have_library'
	from /usr/local/lib/ruby/1.9/mkmf.rb:790:in `block in checking_for'
	from /usr/local/lib/ruby/1.9/mkmf.rb:284:in `block (2 levels) in postpone'
	from /usr/local/lib/ruby/1.9/mkmf.rb:254:in `open'
	from /usr/local/lib/ruby/1.9/mkmf.rb:284:in `block in postpone'
	from /usr/local/lib/ruby/1.9/mkmf.rb:254:in `open'
	from /usr/local/lib/ruby/1.9/mkmf.rb:280:in `postpone'
	from /usr/local/lib/ruby/1.9/mkmf.rb:789:in `checking_for'
	from /usr/local/lib/ruby/1.9/mkmf.rb:840:in `have_library'
	from extconf.rb:93:in `block (3 levels) in <main>'
	from extconf.rb:90:in `each'
	from extconf.rb:90:in `block (2 levels) in <main>'
	from extconf.rb:89:in `loop'
	from extconf.rb:89:in `block in <main>'
	from extconf.rb:87:in `catch'
	from extconf.rb:87:in `<main>'
extconf.rb: Leaving directory `src'
```

--> You have to install development tools first. Which development tools? Or is it a bug?


----------



## SirDice (Aug 22, 2014)

Do you still have some old db4 installed?


```
20131216:
  AFFECTS: users of databases/db4*
  AUTHOR: mandree@FreeBSD.org

  Berkeley DB versions before and excluding 4.8 have been marked deprecated.
  New port installations should be based on Berkeley DB 5 or 6.

  Note that Oracle Berkeley DB 6 is under the more restrictive Affero GPL v3
  license, be sure to review if using that fits your requirements.

  You can add WITH_BDB_VER=5 or WITH_BDB_VER=6 to /etc/make.conf to have all
  applications that get rebuilt use Oracle Berkeley DB 5 or 6, respectively.

  DO NOT FORCE DELETE older BerkeleyDB packages, that breaks the upgrade
  tools.  Instead, first rebuild the ports that depend on it, then
  remove the old Berkeley DB versions.

  Berkeley DB ports should be able to build/install with an older and a
  newer version version both installed if WITH_BDB_VER is set.  If a
  port then grabs the old Berkeley DB version, that is an issue with the
  port that requires Berkeley DB, and should be reported to the
  maintainer.

  If you are interested in upgrading now already, we have instructions
  at <https://wiki.freebsd.org/Ports/BerkeleyDBCleanup>.
```


----------



## kpa (Aug 22, 2014)

The 
	
	



```
WITH_BDB_VER=5
```
 setting is probably bit safer than 
	
	



```
WITH_BDB_VER=6
```
 There are some ports like mail/mutt that fail to compile if forced to use databases/db6 but do compile with databases/db5.


----------



## talsamon (Aug 22, 2014)

I have recompiled subversion and cyrus-sasl with 
	
	



```
WITH_BDB_VER=5
```
 But Ruby-bdb fails to compile with or without it. I have removed  databaases/db42  and databases/db41, only keeping databases/db48 and databases/db5. Should I remove all db\* and install it completely anew? I doubt it helps.


----------



## SirDice (Aug 22, 2014)

Looking at the error message it looks like it's trying to link with db48 when it should link to db5. If there's nothing depending on db48 I would remove it.


----------



## talsamon (Aug 22, 2014)

No, doesn't work. I have deinstalled db48. Same error.

And I had to reinstall db48, *be*cause apache22 and some other programs need it.

The error seems to be in /usr/local/lib/ruby/1.9/mkmf.rb.


----------



## wblock@ (Aug 22, 2014)

talsamon said:
			
		

> No, doesn't work. I have deinstalled db48. Same error.
> 
> And I had to reinstall db48, cause apache22 and some other programs need it.



No, they do not.  But they do have to be rebuilt to use the later version.  This is described in /usr/ports/UPDATING.


----------



## talsamon (Aug 22, 2014)

I have recompiled before apache22 and other ports. Something is going wrong. I had to recompile it a second time. Now I can deinstall db48. databases/ruby-bdb compiles. Thanks.


----------

