in reply to Perl DBI installation problem on MacOS Sierra - Can't open blib/lib/DBI/Util/

Hello Nanjizal,

Welcome to the Monastery. As far as I understand you are trying to install the module manually, why?

If there is no obvious reason that I am no aware why you do not try installing it through cpan or cpanminus find more information here How to install CPAN modules.

Also since you are running on MacOS I assume your software is up to date, why you are running Perl 5.18.2 latest version is 5.26.1. If you want to upgrade you can either download it and do it manually from here Perl or you can open a terminal and type cpan<code> enter. Then simply type <code>install CPAN enter, as soon as this finish type reload cpan enter. Observe the difference between small case letters and upper case.

Update: It was many years ago since the last time that I used a MacOS so maybe I skipped something. So I found this article Using CPAN to Extend Perl on Mac OS X. Where I quote:

Configuring Your Mac to Use CPAN Before we get into using CPAN to install modules for your own code, le +t's talk what happens if you find a really cool project on the Intern +et that uses CPAN modules. To get that code up and running, you'll ne +ed to install the modules from CPAN to your computer. So let's config +ure your Mac to use CPAN before we do anything else. First, CPAN uses some low-level tools to install modules on your Mac. +Therefore, you will need to have either Xcode installed from the Mac +App Store or you will need to download the Command Line Tools for Xco +de package from Apple's Developer site. (Note that you need a free de +veloper account to download these tools.) Once you have either Xcode +or the Developer tools, let's install some modules!

This is a mandatory step before you open a terminal and type cpan. Have you installed Xcode?.

If you still having problems, update your question.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^2: Perl DBI installation problem on MacOS Sierra - Can't open blib/lib/DBI/Util/
by Nanjizal (Novice) on Oct 26, 2017 at 17:11 UTC

    Hi thanos1983, Many thanks for your response. I first tried installing DBI via CPAN and had the same problem, so I tried the manual installation instead. I have Xcode installed. I haven't altered any Perl settings and am just using what came installed. I tried upgrading via perl.org, and downloaded the suggested active Perl package, but this doesn't seem to have changed my Perl version - when I type perl -v I still get v5.18.2. I tried updating via cpan by following your instructions and got another error included below. I assume I am doing something pretty basic wrong here, perhaps relating to the way Perl is set up on my machine? Any pointers would be very gratefully received. Many thanks.

      Hello again Nanjizal,

      First of all do not worried for obvious mistakes we all being there and believe me all of us (at least the majority) we are still here. Maybe this minor problem it looks big to you but we also face minor problems that looks huge to us.

      Moving on to resolve the issue, regarding install CPAN. It is very important to read the stdout of the modules. By 99.9% usually contains the answer to your problems.

      Read carefully this part:

      Warning: Prerequisite 'Mac::SystemDirectory => 0.04' for 'REHSACK/File +-HomeDir-1.002.tar.gz' failed when processing 'ETHER/Mac-SystemDirect +ory-0.10.tar.gz' with 'make_test => NO'. Continuing, but chances to s +ucceed are limited.

      The same error you get at the end also. Try as sudo (if there is I can not remember):

      sudo cpan Mac::SystemDirectory

      If everything works fine, do again install CPAN and reload cpan. In case of another error repeat again and again until you make it work ;)

      Always but always read the output 99.9% in all cases contains hints on how to resolve issues not only for Perl but in general.

      Minor hint, when you are posting a huge bunch of coding lines use <readmore> and </readmore> it helps a lot for readability reasons.

      Try it out and if you get any problems comment again.

      BR / Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!

        Hi Thanos,

        Thanks again for the tips.

        I tried the:

        sudo cpan Mac::SystemDirectory

        But this presented new errors (below). The output is quite dense and I don't understand most of it. There is a suggestion that I should install the Mac::SystemDirectory module, but my plan is to work using PerlBrew from now on after Ken's comment below (after I can get it to successfully install Perl!)

        <readmore> Running install for module 'Mac::SystemDirectory' Running make for E/ET/ETHER/Mac-SystemDirectory-0.10.tar.gz Checksum for /Users/AH590/.cpan/sources/authors/id/E/ET/ETHER/Mac-Syst +emDirectory-0.10.tar.gz ok CPAN.pm: Building E/ET/ETHER/Mac-SystemDirectory-0.10.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Mac::SystemDirectory Writing MYMETA.yml and MYMETA.json cp lib/Mac/SystemDirectory.pm blib/lib/Mac/SystmDirrectory.pm /usr/bin/perl /System/Library/Perl/5.18/ExtUtils/xsubpp -typemap /Sys +tem/Library/Perl/5.18/ExtUtils/typemap SystemDirectory.xs > SystemDi +rectory.xsc && mv SystemDirectory.xsc SystemDirectory.c cc -c -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fn +o-strict-aliasing -fstack-protector -Os -DVERSION=\"0.10\" -DXS_VER +SION=\"0.10\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2leve +l/CORE" -ObjC -DHAS_BOOL SystemDirectory.c SystemDirectory.xs:8:8: warning: extra tokens at end of #endif directi +ve [-Wextra-tokens] #endif Move ^ // SystemDirectory.xs:12:8: warning: extra tokens at end of #endif direct +ive [-Wextra-tokens] #endif I_POLL ^ // SystemDirectory.xs:92:12: warning: enumeration values 'NSAutosavedInfo +rmationDirectory', 'NSApplicationScriptsDirectory', and 'NSTrashDirectory' not handled in switch [-Wswitch] switch(directory) { ^ SystemDirectory.xs:92:12: note: add missing switch cases switch(directory) { ^ 3 warnings generated. SystemDirectory.xs:8:8: warning: extra tokens at end of #endif directi +ve [-Wextra-tokens] #endif Move ^ // SystemDirectory.xs:12:8: warning: extra tokens at end of #endif direct +ive [-Wextra-tokens] #endif I_POLL ^ // SystemDirectory.xs:92:12: warning: enumeration values 'NSAutosavedInfo +rmationDirectory', 'NSApplicationScriptsDirectory', and 'NSTrashDirectory' not handled in switch [-Wswitch] switch(directory) { ^ SystemDirectory.xs:92:12: note: add missing switch cases switch(directory) { ^ 3 warnings generated. Running Mkbootstrap for Mac::SystemDirectory () chmod 644 SystemDirectory.bs rm -f blib/arch/auto/Mac/SystemDirectory/SystemDirectory.bundle cc -mmacosx-version-min=10.12.5 -arch x86_64 -arch i386 -bundle -unde +fined dynamic_lookup -fstack-protector -lobjc -framework CoreFoundati +on -framework Foundation SystemDirectory.o -o blib/arch/auto/Mac/Sys +temDirectory/SystemDirectory.bundle \ \ chmod 755 blib/arch/auto/Mac/SystemDirectory/SystemDirectory.bundle cp SystemDirectory.bs blib/arch/auto/Mac/SystemDirectory/SystemDirecto +ry.bs chmod 644 blib/arch/auto/Mac/SystemDirectory/SystemDirectory.bs Manifying blib/man3/Mac::SysteDirecttory.3pm ETHER/Mac-SystemDirectory-0.10.tar.gz /usr/local/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_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-report-prereqs.t .. # # Versions for all modules listed in MYMETA.json (including optional o +nes): # # === Configure Requires === # # Module Want Have # ------------------- ---- ---- # ExtUtils::MakeMaker any 6.66 # # === Build Requires === # # Module Want Have # ------------------- ---- ---- # ExtUtils::MakeMaker any 6.66 # # === Test Requires === # # Module Want Have # ------------------- ---- ---- # ExtUtils::MakeMaker any 6.66 # File::Spec any 3.40 # Test::More any 0.98 # # === Test Recommends === # # Module Want Have # ---------- -------- -------- # CPAN::Meta 2.120900 2.133380 # # === Runtime Requires === # # Module Want Have # -------- ---- ---- # Exporter any 5.68 # XSLoader any 0.16 # strict any 1.07 # warnings any 1.18 # # === Other Modules === # # Module Have # ------------- ------- # JSON::PP 2.27202 # Pod::Coverage missing # Sub::Name 0.05 # YAML missing # autodie 2.13 # t/00-report-prereqs.t .. ok t/000_load.t ........... 1/1 # Failed test 'use Mac::SystemDirectory;' # at t/000_load.t line 7. # Tried to use 'Mac::SystemDirectory'. # Error: Can't locate Mac/SystemDirectory.pm in @INC (you may nee +d to install the Mac::SystemDirectory module) (@INC contains: /Users/ +AH590/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/lib /Users/AH5 +90/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/arch /Library/Per +l/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library +/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Lib +rary/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-mult +i-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/d +arwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at (eva +l 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. Use of uninitialized value $Mac::SystemDirectory::VERSION in concatena +tion (.) or string at t/000_load.t line 10. # Mac::SystemDirectory , Perl 5.018002, /usr/bin/perl # Looks like you failed 1 test of 1. t/000_load.t ........... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests t/005_import.t ......... # limiting available functions to Mac OS X 10 +.12 t/005_import.t ......... 1/1 # Failed test 'use Mac::SystemDirectory;' # at t/005_import.t line 74. # Tried to use 'Mac::SystemDirectory'. # Error: Can't locate Mac/SystemDirectory.pm in @INC (you may nee +d to install the Mac::SystemDirectory module) (@INC contains: /Users/ +AH590/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/lib /Users/AH5 +90/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/arch /Library/Per +l/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library +/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Lib +rary/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-mult +i-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/d +arwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at (eva +l 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. # Looks like you failed 1 test of 1. t/005_import.t ......... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests t/010_usage.t .......... 1/9 # Failed test 'use Mac::SystemDirectory;' # at t/010_usage.t line 7. # Tried to use 'Mac::SystemDirectory'. # Error: Can't locate Mac/SystemDirectory.pm in @INC (you may nee +d to install the Mac::SystemDirectory module) (@INC contains: /Users/ +AH590/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/lib /Users/AH5 +90/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/arch /Library/Per +l/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library +/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Lib +rary/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-mult +i-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/d +arwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at (eva +l 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. # Failed test 'FindDirectory() without arguments throws an usage exc +eption' # at t/010_usage.t line 11. # 'Undefined subroutine &main::FindDirectory called +at t/010_usage.t line 10. # ' # doesn't match '(?^:^Usage: )' # Failed test 'FindDirectory() with to may arguments throws an usage + exception' # at t/010_usage.t line 14. # 'Undefined subroutine &main::FindDirectory called +at t/010_usage.t line 13. # ' # doesn't match '(?^:^Usage: )' # Failed test 'FindDirectory(0) lives' # at t/010_usage.t line 17. # got: 'Undefined subroutine &main::FindDirectory called at t +/010_usage.t line 16. # ' # expected: '' # Failed test 'FindDirectory(0, 0) lives' # at t/010_usage.t line 20. # got: 'Undefined subroutine &main::FindDirectory called at t +/010_usage.t line 19. # ' # expected: '' # Failed test 'HomeDirectory() with arguments throws an usage except +ion' # at t/010_usage.t line 23. # 'Undefined subroutine &main::HomeDirectory called +at t/010_usage.t line 22. # ' # doesn't match '(?^:^Usage: )' # Failed test 'HomeDirectory() lives' # at t/010_usage.t line 26. # got: 'Undefined subroutine &main::HomeDirectory called at t +/010_usage.t line 25. # ' # expected: '' # Failed test 'TemporaryDirectory() with arguments throws an usage e +xception' # at t/010_usage.t line 29. # 'Undefined subroutine &main::TemporaryDirectory ca +lled at t/010_usage.t line 28. # ' # doesn't match '(?^:^Usage: )' # Failed test 'HomeDirectory() lives' # at t/010_usage.t line 32. # got: 'Undefined subroutine &main::TemporaryDirectory called + at t/010_usage.t line 31. # ' # expected: '' # Looks like you failed 9 tests of 9. t/010_usage.t .......... Dubious, test returned 9 (wstat 2304, 0x900) Failed 9/9 subtests t/020_basic.t .......... 1/3 # Failed test 'use Mac::SystemDirectory;' # at t/020_basic.t line 7. # Tried to use 'Mac::SystemDirectory'. # Error: Can't locate Mac/SystemDirectory.pm in @INC (you may nee +d to install the Mac::SystemDirectory module) (@INC contains: /Users/ +AH590/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/lib /Users/AH5 +90/.cpan/build/Mac-SystemDirectory-0.10-_VwK_a/blib/arch /Library/Per +l/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library +/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Lib +rary/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-mult +i-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/d +arwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at (eva +l 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. Bareword "NSApplicationDirectory" not allowed while "strict subs" in u +se at t/020_basic.t line 10. Execution of t/020_basic.t aborted due to compilation errors. # Looks like you planned 3 tests but ran 1. # Looks like you failed 1 test of 1 run. # Looks like your test exited with 255 just after 1. t/020_basic.t .......... Dubious, test returned 255 (wstat 65280, 0xff +00) Failed 3/3 subtests Test Summary Report ------------------- t/000_load.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 t/005_import.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 t/010_usage.t (Wstat: 2304 Tests: 9 Failed: 9) Failed tests: 1-9 Non-zero exit status: 9 t/020_basic.t (Wstat: 65280 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 255 Parse errors: Bad plan. You planned 3 tests but ran 1. Files=5, Tests=13, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.16 cusr + 0.02 csys = 0.21 CPU) Result: FAIL Failed 4/5 test programs. 12/13 subtests failed. make: *** [test_dynamic] Error 255 ETHER/Mac-SystemDirectory-0.10.tar.gz /usr/local/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports ETHER/Mac-SystemDirectory-0.10.tar.gz Running make install make test had returned bad status, won't install without force </readmore>