Thread: Unable to install DBD module

Unable to install DBD module

From
James Hall
Date:
Hello,

I am trying to install the DBD module and having some problems...

-When trying to install 'DBD-Pg-0.95.tar.gz' I receive the following error
after running 'perl Makefile.PL':
"... Please set environment variables POSTGRES_INCLUDE and POSTGRES_LIB !"

-When trying to install 'DBD-Pg-0.73-1.i386.rpm' I receive the following
error:
"DBI is needed by DBD-Pg-0.73-1" [which is installed...] and "libpq.so.1 is
needed by DBD-Pg-0.73-1"

-When trying to install 'perl-DBD-Pg-0.91-2.i386.rpm' I receive the
following error:
"libpq.so.2.0 is needed by perl-DBD-Pg-0.91-2"

My setup is Redhat 6.2, Postgres 7.0.2-2,
also installed is DBI-1.14.
libpq.so.2.0 is located in '/usr/lib/',
libpq.so.1 is not installed on my system,
my ld.so.conf file has the following lines:
/usr/lib
/usr/include/pgsql/lib
/usr/include/pgsql/libpq
[+ others]

If anyone can help me with this I would be very grateful!

Thanks in advance,
Jim

Re: Unable to install DBD module

From
ghaverla@freenet.edmonton.ab.ca
Date:
On Fri, 15 Sep 2000, James Hall wrote:

> I am trying to install the DBD module and having some problems...
>
> -When trying to install 'DBD-Pg-0.95.tar.gz' I receive the following error
> after running 'perl Makefile.PL':
> "... Please set environment variables POSTGRES_INCLUDE and POSTGRES_LIB !"

Okay, it sounds like you don't understand the error message.
Do you know what it means to set an environment variable?
PATH is one environment variable which most people know of.
If you 'echo $PATH' on a command line, it will tell you the
contents of the PATH variable.  The perl install program needs
to use the contents of the POSTGRES_INCLUDE and POSTGRES_LIB
variables in order to properly install itself.  When the install
program ran, it found those variables either not defined, or if
defined their contents were empty.  The INLCUDE variable needs
to contain the path to some header file (Pg.h ?), and the LIB
variable needs to include the path to some library file (libpg.so ?).
If you were running bash as a shell, and the header file was in the
directory /tmp, you could set the variable as:
 export POSTGRES_INCLUDE=/tmp
(Note, this will not be the path for your, or any other system.)

> -When trying to install 'DBD-Pg-0.73-1.i386.rpm' I receive the following
> error:

So, when a source code install of the 0.95 version of DBD failed,
you tried a binary install of 0.73.  There is nothing particularly
wrong with trying to install a binary version of an older package,
I hope you at least tried to uninstall the source version of the
newer package.  No sense cluttering things up too much.

> "DBI is needed by DBD-Pg-0.73-1" [which is installed...] and "libpq.so.1 is
> needed by DBD-Pg-0.73-1"

And the 0.73 version still needs POSTGRES_LIB to point at the
libpq.so.1 library file (or you don't have the library installed).

> -When trying to install 'perl-DBD-Pg-0.91-2.i386.rpm' I receive the
> following error:
> "libpq.so.2.0 is needed by perl-DBD-Pg-0.91-2"

And now we try yet another package, again binary.  It too needs
to find a version of the libpq.so library, this time at revision
2.0.

I run a system that uses DEBs, not RPMs, but I thought RPM
would handle the library location.  Usually, one doesn't need
to set environment variables when using these binary packages,
this is usually set somewhere inside the package if it needs to be.
However, their are quite a few flavours of RPM, and maybe you are
using the wrong flavour of RPM.  Did you get your RPM from redhat.com?
Or is it maybe that you got a SuSE or some other kind of RPM from
rpmfind?  It might be that the RPM you were trying to install is
looking someplace other than /usr/lib.

I don't really see anything wrong with how you tried to install
the RPMs, I suspect you just used the wrong kind of RPM (SuSE
or Mandrake or .... instead of RedHat).  This problem has more to
do with different distributions putting files in different places
than anything being incompatible.  You could set up symbollic links
(don't copy the files, that wastes space.  don't move the file,
you might break programs already installed and working) to enable
the installation to run to completion.

Gord

Matter Realisations     http://www.materialisations.com/
Gordon Haverland, B.Sc. M.Eng. President
101  9504 182 St. NW    Edmonton, AB, CA  T5T 3A7
780/481-8019            ghaverla @ freenet.edmonton.ab.ca



Re: Unable to install DBD module

From
Neil Conway
Date:
On Fri, Sep 15, 2000 at 08:05:28AM -0600, ghaverla@freenet.edmonton.ab.ca wrote:
> On Fri, 15 Sep 2000, James Hall wrote:
> > -When trying to install 'DBD-Pg-0.95.tar.gz' I receive the following error
> > after running 'perl Makefile.PL':
> > "... Please set environment variables POSTGRES_INCLUDE and POSTGRES_LIB !"
>
> [snip] The perl install program needs
> to use the contents of the POSTGRES_INCLUDE and POSTGRES_LIB
> variables in order to properly install itself.  When the install
> program ran, it found those variables either not defined, or if
> defined their contents were empty.  The INLCUDE variable needs
> to contain the path to some header file (Pg.h ?), and the LIB
> variable needs to include the path to some library file (libpg.so ?).

Well, it needs to be set to the path of the directory containing
the PgSQL libs or headers (that's probably what you meant).
With a standard PgSQL install from source and sh, you should do
the following:

export POSTGRES_INCLUDE=/usr/local/pgsql/include
export POSTGRES_LIB=/usr/local/pgsql/lib

If you're running a variant of csh, do:

setenv POSTGRES_INCLUDE /usr/local/pgsql/include
setenv POSTGRE_LIB /usr/local/pgsql/lib

Note that to install a DBD, you need to install DBI (or at least, to
use the DBD - I'm not sure if it's a preinstall requirement). You
can get DBI from CPAN, just like DBD::Pg

Just a note - when you get an error message, pay attention to what
it says. If you'd have diagnosed the problem with the original
install of DBD::Pg 0.95, you wouldn't have wasted time with the
other (old, possibly broken/buggy) packages of DBD::Pg. Error
messages are supossed to be informative.

HTH,

Neil

--
Neil Conway <neilconway@home.com>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

Vegetarians do not love animals... they hate plants.

Attachment