2007年11月19日

CPAN module 升級問題

原先裝於 CentOS 4.5 的 CPAN 模組版本為 1.7,每次進入 cpan> 時,總會提醒我有更新版 1.9,但一直無法升級,使得 RT 只剩下空白頁面,等同倒站。一直卡在 Scalar::Util 檢查錯誤,而 Scalar::Util 確定已是最新版,怎會這樣呢?

在嘗試安裝其它模組時,如 IO::Compress::Base,會顯示 You don't have the XS version of Scalar::Util,用 google 搜了好久,終於看到一段有用的文字...
Reinstalling all packages seems a fairly drastic step. I would have thought
that reinstalling Scalar::Util would have been enough to sort this out.
- Paul

When Paul mentioned "reinstalling Scalar::Util" he meant that the
reinstallation be done by building from the CPAN source distribution
of Scalar::Util. Is that what you tried ? (Reinstalling an RPM
wouldn't help if the RPM package is not an XS build.)
Even then, building Scalar::Util from source won't give you an XS
build if a C compiler is not found - in which case (I think) you'll be
informed, during the build process, that you're not getting the XS
build.
- Cheers, Rob
就是 這段文章 解決我的升級,如果你也遇到相似的問題, 試試重新編譯 Scalar::Util 吧。

首先確定你的系統有 C Compiler, 如 gcc
[~]# rpm -qa | grep gcc

至 search.cpan.org 下載最新版 Scalar-List-Utils 的 Source
[~]# wget http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Scalar-List-Utils-xx.tar.gz

解壓縮及編譯
[~]# tar xzf Scalar-List-Utils-xx.tar.gz
[~]# cd Scalar-List-Utils-xx
[~]# perl Makefile.PL
[~]# make
[~]# make install

升級 CPAN
[~]# cpan
cpan> install CPAN
....
過程中發現少裝了 IO::Zlib,所以有些錯誤訊息。
cpan > install IO::Zlib
cpan > install CPAN
cpan > reload cpan

重新進入 cpan 時,回答幾個問題後就可以了。

重新啟動 apache,於是乎 RT 又再次正常運作了。

沒有留言: