perlbrew on OSX
I’ve tried and failed so many times to use perlbrew on OSX.
I’ll admit that I haven’t started a full-on investigation, but this is really quite frustrating and confusing:
➔ perlbrew install perl-5.20.0
Fetching perl 5.20.0 as /Users/c.wright/perl5/perlbrew/dists/perl-5.20.0.tar.bz2
Download http://www.cpan.org/src/5.0/perl-5.20.0.tar.bz2 to /Users/c.wright/perl5/perlbrew/dists/perl-5.20.0.tar.bz2
Installing /Users/c.wright/perl5/perlbrew/build/perl-5.20.0 into ~/perl5/perlbrew/perls/perl-5.20.0
This could take a while. You can run the following command on another shell to track the status:
tail -f ~/perl5/perlbrew/build.perl-5.20.0.log
perl-5.20.0 is successfully installed.
➔ perlbrew switch perl-5.20.0
➔ which perl
/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin/perl
➔ perlbrew install-cpanm
cpanm is installed to
/Users/c.wright/perl5/perlbrew/bin/cpanm
➔ cpanm MP3::Info
--> Working on MP3::Info
Fetching http://cpanmirror.wtf.nap/authors/id/D/DA/DANIEL/MP3-Info-1.24.tar.gz ... OK
Configuring MP3-Info-1.24 ... OK
Building and testing MP3-Info-1.24 ... OK
Successfully installed MP3-Info-1.24
1 distribution installed
➔ perl -MMP3::Info -e1
Can't locate MP3/Info.pm in @INC (you may need to install the MP3::Info module) (@INC contains: /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/darwin-2level /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0 /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/5.20.0/darwin-2level /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/5.20.0 .).
BEGIN failed--compilation aborted.
➔ /Users/c.wright/perl5/perlbrew/bin/cpanm MP3::Info
MP3::Info is up to date. (1.24)
sigh
Slightly suspicious double-slash here:
➔ find /Users/c.wright/perl5/ -name Info.pm
/Users/c.wright/perl5//lib/perl5/MP3/Info.pm
Have you sourced?
source ~/perl5/perlbrew/etc/bashrc
Yes, sorry, I should have included that:
504 \curl -L http://install.perlbrew.pl | bash
505 source ~/perl5/perlbrew/etc/bashrc
506 perlbrew available
507 perlbrew install perl-5.20.0
508 perlbrew switch perl-5.20.0
The output of
cpanm -v MP3::Info
would be very helpful in tracking down the problem.➔ cpanm -v MP3::Info
cpanm (App::cpanminus) 1.7001 on perl 5.020000 built for darwin-2level
Work directory is /Users/c.wright/.cpanm/work/1406801664.10338
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.98)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.67)
Searching MP3::Info on mirror http://cpanmirror.wtf.nap ...
Downloading index file http://cpanmirror.wtf.nap/modules/02packages.details.txt.gz ...
######################################################################## 100.0%
Uncompressing index file...
MP3::Info is up to date. (1.24)
➔ cpanm -f -v MP3::Info
cpanm (App::cpanminus) 1.7001 on perl 5.020000 built for darwin-2level
Work directory is /Users/c.wright/.cpanm/work/1406801700.10348
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.98)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.67)
Searching MP3::Info on mirror http://cpanmirror.wtf.nap ...
Downloading index file http://cpanmirror.wtf.nap/modules/02packages.details.txt.gz ...
######################################################################## 100.0%
Uncompressing index file...
--> Working on MP3::Info
######################################################################## 100.0%...
OK
Unpacking MP3-Info-1.24.tar.gz
x MP3-Info-1.24/
x MP3-Info-1.24/inc/
x MP3-Info-1.24/inc/Module/
x MP3-Info-1.24/inc/Module/Install.pm
x MP3-Info-1.24/inc/Module/Install/
x MP3-Info-1.24/inc/Module/Install/AutoInstall.pm
x MP3-Info-1.24/inc/Module/Install/Fetch.pm
x MP3-Info-1.24/inc/Module/Install/Makefile.pm
x MP3-Info-1.24/inc/Module/Install/Include.pm
x MP3-Info-1.24/inc/Module/Install/Base.pm
x MP3-Info-1.24/inc/Module/Install/Metadata.pm
x MP3-Info-1.24/inc/Module/Install/Can.pm
x MP3-Info-1.24/inc/Module/Install/WriteAll.pm
x MP3-Info-1.24/inc/Module/Install/Win32.pm
x MP3-Info-1.24/inc/Module/AutoInstall.pm
x MP3-Info-1.24/Changes
x MP3-Info-1.24/t/
x MP3-Info-1.24/t/test1.mp3
x MP3-Info-1.24/t/id3.t
x MP3-Info-1.24/t/testv1.mp3
x MP3-Info-1.24/t/testv2.2.0.mp3
x MP3-Info-1.24/t/getset.t
x MP3-Info-1.24/t/testv2.3.0.mp3
x MP3-Info-1.24/t/testv1.1.mp3
x MP3-Info-1.24/t/test2.mp3
x MP3-Info-1.24/t/testv2.4.0.mp3
x MP3-Info-1.24/t/test.aiff
x MP3-Info-1.24/t/lame-info.t
x MP3-Info-1.24/t/remove.t
x MP3-Info-1.24/MANIFEST
x MP3-Info-1.24/TODO
x MP3-Info-1.24/eg/
x MP3-Info-1.24/eg/mp3tag.PL
x MP3-Info-1.24/eg/mp3tocddb.PL
x MP3-Info-1.24/Info.pm
x MP3-Info-1.24/README
x MP3-Info-1.24/Makefile.PL
Entering MP3-Info-1.24
META.yml/json not found. Creating skeleton for it.
Running Makefile.PL
Configuring MP3-Info-1.24 ... Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for MP3::Info
Writing MYMETA.yml and MYMETA.json
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.98)
Building and testing MP3-Info-1.24 ... cp Info.pm blib/lib/MP3/Info.pm
Manifying blib/man3/MP3::Info.3
PERL_DL_NONLAZY=1 /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/getset.t t/id3.t t/lame-info.t t/remove.t
t/getset.t ..... ok
t/id3.t ........ ok
t/lame-info.t .. ok
t/remove.t ..... ok
All tests successful.
Files=4, Tests=246, 1 wallclock secs ( 0.05 usr 0.01 sys + 0.21 cusr 0.04 csys = 0.31 CPU)
Result: PASS
Appending installation info to /Users/c.wright/perl5/lib/perl5/darwin-2level/perllocal.pod
OK
Successfully reinstalled MP3-Info-1.24
Installing /Users/c.wright/perl5/lib/perl5/darwin-2level/.meta/MP3-Info-1.24/install.json
1 distribution installed
➔ env |grep -i perl
MANPATH=/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/man:/usr/share/man:/usr/local/share/man:/usr/local/git/share/man
PERLBREW_VERSION=0.69
PERLBREW_PERL=perl-5.20.0
PERLBREW_BASHRC_VERSION=0.69
PERLBREW_ROOT=/Users/c.wright/perl5/perlbrew
PATH=/Users/c.wright/perl5/perlbrew/bin:/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin:/Users/c.wright/.vim/bin:/Users/c.wright/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/go/bin:/usr/local/munki:/Users/c.wright/go/bin
PERLBREW_HOME=/Users/c.wright/.perlbrew
PERL_CPANM_OPT=--local-lib ~/perl5 --mirror http://cpanmirror.wtf.nap --mirror-only
PERLBREW_MANPATH=/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/man
PERLBREW_PATH=/Users/c.wright/perl5/perlbrew/bin:/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin
The problem is that you are installing modules into a local::lib, but that directory isn't part of the library search path.
PERL_CPANM_OPT=--local-lib ~/perl5
means that things are always installed into ~/perl5, but the corresponding PERL5LIB isn't set up to load from there. With perlbrew, you can either install modules directly into perl's normal paths by dropping the local::lib entirely, or you can use perlbrew's built in local::lib support.perlbrew lib create base; perlbrew switch perl-5.20.0@base
Argh! I set that '--local-lib' so long ago, I'm not even sure when, or why, I did it.
Thank you so much for taking the time to trawl through my output and spot that.
Removed that from the PERL_CPANM_OPT and successfully installed and perldoc'd a new module.
As always ... it was down to me doing something daft.
> As always ... it was down to me doing something daft.
So it is for all of us :)