I have Perl5.28 installed and Net::LibIDN installed but amavisd cant find it - macos

I'm on a MacMini, using Homebrew to install things.
But - amavisd can't start because apparently it can't find this Net::IDN module?
I'm getting this
ERROR: MISSING REQUIRED BASIC MODULES:
Net::LibIDN
BEGIN failed--compilation aborted at /usr/local/sbin/amavisd line 251.
But I'm sure it is installed.
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/install- 0.01.tar.gz ... OK
Configuring install-0.01 ... OK
Building and testing install-0.01 ... OK
Successfully installed install-0.01
Net::LibIDN is up to date. (0.12)
1 distribution installed
So how do I tell Perl to find it now?
EDIT:
So I'm forcing a reinstall - but still no joy
zeus:~ robert$ sudo cpanm --reinstall Net::LibIDN
Password:
--> Working on Net::LibIDN
Fetching http://www.cpan.org/authors/id/T/TH/THOR/Net-LibIDN-0.12.tar.gz ... OK
Configuring Net-LibIDN-0.12 ... OK
Building and testing Net-LibIDN-0.12 ... OK
Successfully reinstalled Net-LibIDN-0.12
1 distribution installed
zeus:~ robert$
and trying to run amavisd ...
zeus:~ robert$ sudo /usr/local/sbin/amavisd -c /usr/local/etc/amavisd.conf debug
Password:
ERROR: MISSING REQUIRED BASIC MODULES:
Net::LibIDN
BEGIN failed--compilation aborted at /usr/local/sbin/amavisd line 251.
zeus:~ robert$
So for some reason, it seems amavisd-new can't find the module. Just that Module?

It's because amavisd uses the system perl, while cpanm was installed to a custom perl and installs modules there.
Either install the module to system perl, or try to convince amavisd to run in the custom perl (might involve manually changing the shebang lines in its source files).

Related

How to install Net::SSH2 from CPAN on Cygwin

I needed to install Net:SSH2 in a Cygwin environment under Windows 7 (64 bit). As usually I tried to install it with cpanm.
I already had the necessary Cygwin packages (see below) installed but the Perl build failed because it couldn't find the libssh2 library.
There is a special text file BUILDING.WIN32 in the Net::SSH2 package but this is only useful when building the module by hand and it refers mainly to MinGW. So this no help.
This is the log of the build:
Entering Net-SSH2-0.53
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 6.59 ... Yes (7.02)
Running Makefile.PL
Configuring Net-SSH2-0.53 ... Subroutine checklibs redefined at inc/Module/Install/CheckLib.pm line 11.
Subroutine assertlibs redefined at inc/Module/Install/CheckLib.pm line 25.
Subroutine _author_side redefined at inc/Module/Install/CheckLib.pm line 39.
The libssh2 library is required by this module. If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can
be obtained from http://www.openssl.org , or libgcrypt, which can be obtained
from http://www.gnupg.org .
Debian: sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel
You can pass your libssh2 lib and include dirs (and extra link args) on the
command line. E.g.:
perl Makefile.PL lib=$HOME/libssh2/lib inc=$HOME/libssh2/include \
ldargs="-lz"
These can also be set through the LIBSSH2_LIB/LIBSSH2_INCLUDE/LIBSSH2_LDARGS
environment variables.
To build with libgcrypt instead of OpenSSL, pass 'gcrypt' as a parameter to
Makefile.PL, e.g.:
perl Makefile.PL gcrypt
If you want to build on Windows, see the file BUILDING.WIN32 in the
distribution.
Can't link/include C library 'ssh2', aborting.
First install the libssh2-devel package from Cygwin, e.g. with apt-cyg the command line frontend for installing packages from within a cygwin shell.
apt-cyg install libssh2-devel
Then set some environment variables to the right path for getting Net::SSH2 to work with the Cygwin packages:
LIBSSH2_LIB=/usr/lib/ LIBSSH2_INCLUDE=/usr/include/ cpanm -v Net::SSH2
That worked for me. Much easier than what the readme file linked above looked like.

Wordnet::Similarity installation issue

When I install Wordnet::Similarity on mac, the following error occur:
usr/local/bin/perl "-Iblib/arch" "-Iblib/lib" build/Depthfiles.PL blib/lib/WordNet/synsetdepths.dat
Generating default depth files.
Can't load '/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle' for module Digest::SHA1: dlopen(/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle, 1): no suitable image found. Did find:
/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle: mach-o, but wrong architecture at /usr/local/lib/perl5/5.8.8/darwin-2level/DynaLoader.pm line 230.
at blib/lib/WordNet/Tools.pm line 76
Compilation failed in require at blib/lib/WordNet/Tools.pm line 76.
My attempt was to enter to the downloaded package directory from terminal and type:
perl Makefile.PL
make
make test
sudo make install
I made sure to have installed all prerequisite http://search.cpan.org/dist/WordNet-Similarity/doc/install.pod#Prerequisites. I suspect that this may be due to mac processor version with Perl interface. Any suggestion on how to fix this?
Install libdigest-sha-perl in Ubuntu 14.04 has solved this issue.
Download link:http://packages.ubuntu.com/trusty/amd64/perl/libdigest-sha-perl

Why doesn't LWP.pm work on Mac OSX?

I have a Mac Book Pro, it has Perl.
I have a script with includes.
use LWP ;
use HTTP::Request::Common qw{ POST };
use HTML::Form;
LWP so I ran (twice once as root once as normal user) Guide I followed
perl -MCPAN -e 'shell'
install Bundle::LWP
install HTML::Tree
install HTML::Form
Warning: Cannot install HTML::Format, don't know what it is.
It says its missing two dependencies, but when I install them it says they are already done...?
Pastebin showing the output of the dependencies problem
When I run the script this is the error I get:
Can't locate LWP.pm in #INC (#INC contains: /opt/local/lib/perl5/site_perl/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.16.3 /opt/local/lib/perl5/vendor_perl/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.16.3 /opt/local/lib/perl5/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/5.16.3 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl .) at NMLRegAttack2.pl line 1.
BEGIN failed--compilation aborted at NMLRegAttack2.pl line 1.
build_dir_reuse is not set correctly
Solution
cpan
conf build_dir_reuse 0
o conf commit
exit

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo)
Error -60005 occurred while executing script with privileges.
So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer 3.0.0.app/Contents/MacOS
I try this command: (with sudo)
sudo ./Cocos2D\ Installer\ 3.0.0
It works but I got log with some errors:
[1m>>> Installing Cocos2D-v3.0.0 files (B[m
[1m>>> Installing Cocos2D-v3.0.0 templates (B[m
[4m[1mCocos2D Template Installer (Cocos2D-v3.0.0)(B[m
Error: [31m✖︎(B[m Script cannot be executed as root.
In order for it to work properly, please execute the script again without 'sudo'.
If you want to know more about how to use this script execute '/Users/viethung/Downloads/Cocos2D-v3.0.0/install.sh --help'.
[1m>>> Building/Installing Cocos2D-v3.0.0 documentation, this may take a minute.... (B[m
appledoc version: 2.2 (build 963)
Generation step 4/5 failed: GBDocSetInstallGenerator failed generating output, aborting!
Documentation set was installed, but couldn't reload documentation within Xcode.
Xcode got an error: No documentation set present at specified path.
[1m>>> Cocos2D-v3.0.0 installation complete! (B[m
Are there any way is better than this way?
I have same problem.
I think you installed old cocos2d-iphone and it caused this problem.
You should remove old cocos2d-iphone first. I removed:
~/Library/Developer/Xcode/cocos2d v3.x
And install again. It works for me.
Hope it works for you :)

How to downgrade Perl on Mac OS X Mavericks

The newly release Mavericks has removed the deprecated module "Switch.pm" from its repository.
However, I have recently try to build AOSP source tree and it somehow uses this module to generate "make-hash-tools.pl"
The Mavericks has perl version of 5.16.2, and its predecessor Mountain Lion has a 5.12.4. Is there a way to downgrade my Perl?
Compilation error looks like this:
Can't locate Switch.pm in #INC (#INC contains: /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 external/webkit/Source/WebCore\
/make-hash-tools.pl line 23.
Thanks~!
You can use perlbrew to install a parallel version of Perl in its own directory with its own modules. Currently it lets you install Perl as far back as 5.003_07, although not all of them are supported by Perl Porters for security fixes.
It would probably be simpler to install Switch from CPAN though.
looks like running sudo cpanm Switch --force worked for me
you can also use this:
$ sudo defaults write '/Library/Preferences/com.apple.versioner.perl' Version 5.12
It makes perl run version 12 for most stuff. Unfortunately, not for apache ...
Worked for me on 10.9.2, with no "force".
cpan[2]> install Switch
Running install for module 'Switch'
Running make for C/CH/CHORNY/Switch-2.17.tar.gz
Fetching with LWP:
... bunch of fetch stuff ...
CPAN.pm: Building C/CH/CHORNY/Switch-2.17.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Switch
Writing MYMETA.yml and MYMETA.json
... a bunch of xcode license stuff ...
cp Switch.pm blib/lib/Switch.pm
Manifying blib/man3/Switch.3pm
CHORNY/Switch-2.17.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/given.t ... ok
t/nested.t .. ok
t/switch.t .. ok
All tests successful.
Files=3, Tests=590, 0 wallclock secs ( 0.04 usr 0.01 sys + 0.22 cusr 0.01 csys = 0.28 CPU)
Result: PASS
CHORNY/Switch-2.17.tar.gz
/usr/bin/make test -- OK
Running make install
Installing /Library/Perl/5.16/Switch.pm
Installing /usr/local/share/man/man3/Switch.3pm
Appending installation info to /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level/perllocal.pod
CHORNY/Switch-2.17.tar.gz
/usr/bin/make install -- OK
I then ran my code that previously pitched the "Can't locate Switch.pm in #INC" error, and the code ran fine.
I found another command :
sudo cpan -f Switch
I had to execute the command 2 times but for me it works on Yosemite. Thank s this blog.
I find these command works.
sudo perl -MCPAN -e shell
cpan > force install Switch

Resources