我有MAMP 3.0.6和MacPorts 2.3.1。我需要使用一些Perl模块(通过一些CGI脚本),我将它们安装在MacPorts Perl安装上(例如p5.16-dbd-mysql
),但我无法弄清楚如何让MAMP使用正确的Perl安装。一个错误如下:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: ../../lib /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at (eval 10) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.
我尝试设置我的.bashrc
文件,但它似乎没有帮助
export PERL5LIB=/opt/local/lib/perl5
我怎样才能解决这个问题?
Perl lib version (5.16.3) doesn't match executable 'the_path_to_cgi.cgi' version (v5.16.2) at /opt/local/lib/perl5/5.16.3/darwin-thread-multi-2level/Config.pm line 60.
我已经升级了所有端口,重新启动了机器,但仍然看到了这一点。有什么建议?顺便说一句,它看起来像第二行需要:SetEnv PERL5LIB /usr/local/lib:/opt/local/lib/perl5/5.16.3