Automação comercial livre no Slackware 12

Fala galera do VOL. Vamos conhecer o programa SQL-Ledger, funcional, leve (muito leve) e o melhor: sob a GPL. O SQL-Ledger funciona baseado em servidor web, banco de dados postgreSQL, CGI e Perl. Vamos ver como instalar o PostgreSQL e colocar o Ledger pra rodar, inclusive fazer as configurações iniciais.

[ Hits: 37.791 ]

Por: Waldemar Wantuil de Souza Neto em 19/03/2008 | Blog: http://upsys.org


Instalando o DBD-pg



O DBD-pg é uma biblioteca de comunicação entre o perl e o PostgreSQL.

Exporte a variável a seguir:

# export POSTGRES_LIB=/usr/local/pgsql/lib

No nosso exemplo estou utilizando DBD-Pg-2.0.0.tar.gz. Baixe o source e descompacte. (Baixando em /opt ou outro lugar que lhe convier)

# tar -xvf DBD-Pg-2.0.0.tar.gz
# perl Makefile.PL
# make test
# make install


Os três primeiro passos também podem ser feitos com usuários comuns.

Página anterior     Próxima página

Páginas do artigo
   1. Introdução
   2. Instalando o PostgreSQL
   3. Instalando o SQL-Ledger
   4. Instalando o DBD-pg
   5. Configurações iniciais
   6. Padronização de códigos e início de uso
   7. Considerações finais
Outros artigos deste autor

Autenticando Linux num PDC Samba com auto-montagem de unidade por usuários (sem usar LDAP)

VPN com pptpd com acesso a compartilhamentos

Leitura recomendada

Autenticação no PostgreSQL - com exemplos

Como instalar Postgres 8 no Linux em 10 passos rápidos

Vacuum - otimizando sua base de dados PostgreSQL

Diagrama Entidade-Relacionamento com Dia e tedia2sql para o PostgreSQL

Instalando e Configurando o pgAgent no Linux (pgAdmin e PostgreSQL)

  
Comentários
[1] Comentário enviado por cazon em 27/06/2008 - 10:19h

To com problemas ao tentar instalar este pack DBD-pg:

# Failed test 'use DBD::Pg;'
# in t/00basic.t at line 13.
# Tried to use 'DBD::Pg'.
# Error: Can't locate version.pm in @INC (@INC contains: /root/files/DBD-Pg-2.8.1/blib/lib /root/files/DBD-Pg-2.8.1/blib/arch /usr/lib/perl5/5.8.8/i486-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i486-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at /root/files/DBD-Pg-2.8.1/blib/lib/DBD/Pg.pm line 20.
# BEGIN failed--compilation aborted at t/00basic.t line 13.
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at (eval 6) line 2.
t/00basic...........NOK 2FAILED--Further testing stopped: Cannot continue without DBD::Pg
make: *** [test_dynamic] Error 9

[2] Comentário enviado por nissieloin em 27/06/2008 - 10:26h

Qual o comando que gerou este erro?

[3] Comentário enviado por cazon em 28/06/2008 - 17:36h

Primeiramente executei o #perl Makefile.PL depois ao executar o "make test" deu este erro.
Veja o processo completo:

root@cazon:~/files/DBD-Pg-2.8.1# perl Makefile.PL
Configuring DBD::Pg 2.8.1
PostgreSQL version: 80303 (default port: 5432)
POSTGRES_HOME: (not set)
POSTGRES_INCLUDE: (not set)
POSTGRES_LIB: /usr/local/pgsql/lib
OS: linux
Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI/ /usr/lib/perl5/vendor_perl/5.8.8/i486-linux-thread-multi/auto/DBI/ at Makefile.PL line 157
Checking if your kit is complete...
Looks good
Warning: prerequisite version 0 not found.
Could not eval '
package ExtUtils::MakeMaker::_version;
no strict;

local $VERSION;
$VERSION=undef; do {
use version; our $VERSION = qv('2.8.1');
}; $VERSION
' in Pg.pm: Can't locate version.pm in @INC (@INC contains: t/lib /usr/lib/perl5/5.8.8/i486-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i486-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at (eval 10) line 7, <FH> line 20.
BEGIN failed--compilation aborted at (eval 10) line 7, <FH> line 20.
WARNING: Setting VERSION via file 'Pg.pm' failed
at /usr/lib/perl5/5.8.8/ExtUtils/MakeMaker.pm line 495
Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI/ /usr/lib/perl5/vendor_perl/5.8.8/i486-linux-thread-multi/auto/DBI/ at Makefile.PL line 231
Using DBI 1.605 (for perl 5.008008 on i486-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::Pg

root@cazon:~/files/DBD-Pg-2.8.1# make test
cp lib/Bundle/DBD/Pg.pm blib/lib/Bundle/DBD/Pg.pm
cp Pg.pm blib/lib/DBD/Pg.pm
/usr/bin/perl5.8.8 -p -e "s/~DRIVER~/Pg/g; s/^do\(/dontdo\(/" /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI/Driver.xst > Pg.xsi
/usr/bin/perl5.8.8 /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap Pg.xs > Pg.xsc && mv Pg.xsc Pg.c
cc -c -I/usr/local/pgsql/include -I/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPGLIBVERSION=80303 -DPGDEFPORT=5432 -O2 -march=i486 -mtune=i686 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"undef\" -DXS_VERSION=\"undef\" -fPIC "-I/usr/lib/perl5/5.8.8/i486-linux-thread-multi/CORE" Pg.c
cc -c -I/usr/local/pgsql/include -I/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPGLIBVERSION=80303 -DPGDEFPORT=5432 -O2 -march=i486 -mtune=i686 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"undef\" -DXS_VERSION=\"undef\" -fPIC "-I/usr/lib/perl5/5.8.8/i486-linux-thread-multi/CORE" dbdimp.c
cc -c -I/usr/local/pgsql/include -I/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPGLIBVERSION=80303 -DPGDEFPORT=5432 -O2 -march=i486 -mtune=i686 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"undef\" -DXS_VERSION=\"undef\" -fPIC "-I/usr/lib/perl5/5.8.8/i486-linux-thread-multi/CORE" quote.c
cc -c -I/usr/local/pgsql/include -I/usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPGLIBVERSION=80303 -DPGDEFPORT=5432 -O2 -march=i486 -mtune=i686 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"undef\" -DXS_VERSION=\"undef\" -fPIC "-I/usr/lib/perl5/5.8.8/i486-linux-thread-multi/CORE" types.c
Running Mkbootstrap for DBD::Pg ()
chmod 644 Pg.bs
rm -f blib/arch/auto/DBD/Pg/Pg.so
LD_RUN_PATH="/usr/local/pgsql/lib" cc -shared -L/usr/local/lib Pg.o dbdimp.o quote.o types.o -o blib/arch/auto/DBD/Pg/Pg.so \
-L/usr/local/pgsql/lib -lpq \

chmod 755 blib/arch/auto/DBD/Pg/Pg.so
cp Pg.bs blib/arch/auto/DBD/Pg/Pg.bs
chmod 644 blib/arch/auto/DBD/Pg/Pg.bs
PGINITDB="/usr/local/pgsql/bin/initdb" PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-signature......skipped
all skipped: Set the environment variable TEST_SIGNATURE to enable this test
t/00basic...........
# Failed test 'use DBD::Pg;'
# in t/00basic.t at line 13.
# Tried to use 'DBD::Pg'.
# Error: Can't locate version.pm in @INC (@INC contains: /root/files/DBD-Pg-2.8.1/blib/lib /root/files/DBD-Pg-2.8.1/blib/arch /usr/lib/perl5/5.8.8/i486-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i486-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at /root/files/DBD-Pg-2.8.1/blib/lib/DBD/Pg.pm line 20.
# BEGIN failed--compilation aborted at t/00basic.t line 13.
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at (eval 6) line 2.
t/00basic...........NOK 2FAILED--Further testing stopped: Cannot continue without DBD::Pg
make: *** [test_dynamic] Error 9

[4] Comentário enviado por nissieloin em 30/06/2008 - 11:03h

O problema ao que tudo indica está no seu perl... talvez a versão seja incompatível ou não esteja totalmente instalado. Ele está dando erro pra gerar o make.

[5] Comentário enviado por cazon em 04/07/2008 - 12:25h

Show de Bola Brô!!!
Reinstalei o Perl de 5.8 pra 5.10 e rolou blzinha agora.
Obrigado
[]ś


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts