CPAN DBI モジュールを手動インストール[Perl]
(2017-05-16 10:45:28) by shinoda


< ページ移動: 1 2 >

以前、俺が Perl で書いた API プログラムについて「別サーバに移したら DBI モジュールが無くて動かないみたいなのでヨロシク」・・・という指示がお客さんからあったので対応。

CentOS サーバなのだが、

# perl
use DBI;
Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 <略> .) at - line 1.
BEGIN failed--compilation aborted at - line 1.

確かに DBI モジュールがインストールされていないようなので入れる。

このサーバ、ローカルネットワークの外には出れないようになっているので、インターネットに接続できる Windows PC でダウンロードしたファイルをサーバに SFTP アップして作業をする。

取ってくるファイルは、最新のアーカイブ。
CPAN サイト
http://search.cpan.org/~timb/DBI/DBI.pm
から、DBI-1.636.tar.gz をダウンロードし、サーバに上げて以下作業を行った。

# tar xvfz DBI-1.636.tar.gz
DBI-1.636/
DBI-1.636/Changes
DBI-1.636/dbd_xsh.h
DBI-1.636/DBI.pm
<略>
DBI-1.636/ex/corogofer.pl
DBI-1.636/ex/perl_dbi_nulls_test.pl
DBI-1.636/ex/profile.pl
# cd DBI-1.636
# perl Makefile.PL

*** Your LANG environment variable is set to 'ja_JP.UTF-8'
*** This may cause problems for some perl installations.
*** If you get test failures, please try again with LANG unset.
*** If that then works, please email dbi-dev@perl.org with details
*** including the output of 'perl -V'

Your perl was compiled with gcc (version 4.1.2 20080704 (Red Hat 4.1.2-55)), okay.
Creating test wrappers for DBD::Gofer:
t/zvg_01basics.t
<略>
Checking if your kit is complete...
Looks good
Warning: prerequisite ExtUtils::MakeMaker 6.48 not found. We have 6.30.
Warning: prerequisite Test::Simple 0.90 not found. We have 0.62.

    I see you're using perl 5.008008 on x86_64-linux-thread-multi, okay.
    Remember to actually *read* the README file!
    Use  'make' to build the software (dmake or nmake on Windows).
    Then 'make test' to execute self tests.
    Then 'make install' to install the DBI and then delete this working
    directory before unpacking and building any DBD::* drivers.

Writing Makefile for DBI

ExtUtils::MakeMaker
Test::Simple
この2つのバージョンが古いって警告(Warning)が出てるけど、この2つを入れ直そうとすると依存関係すごそう(^^;
上に書いたように、依存関係のあるモジュールについても一個一個手動インストールするしかないんで、「ま、Warning なんで・・・」と、とりあえず無視してインストールしちゃう。

# make
<略>
Manifying blib/man3/DBI::DBD.3pm
Manifying blib/man3/Win32::DBIODBC.3pm
Manifying blib/man3/DBI::DBD::SqlEngine.3pm
Manifying blib/man3/DBI::PurePerl.3pm
Manifying blib/man3/DBI::ProfileData.3pm

特にエラーは出てない。問題なく make できたっぽいなあ。
まあ、make test は予想どおりボロボロですけど。

< ページ移動: 1 2 >


コメント投稿
次の記事へ >
< 前の記事へ
TOPへ戻る

Powered by
MT4i 3.0.8