Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl version issue?

by farang (Chaplain)
on Oct 27, 2014 at 01:11 UTC ( #1105069=note: print w/replies, xml ) Need Help??


in reply to Perl version issue?

It looks to me as though your problem is a result of two things. First, you previously altered your system perl in order to install Locale:gettext. Second, you upgraded your operating system instead of doing a clean install. Here are three different actions, any one of which may get you working again.

  1. Enter the command which -a perl and see if your v5.16 Perl shows up. If it does, hard code the path into your startup script, possibly at line 1147 of the file listed in the error. This solution is hackish, may come back to bite you in the future, but if it works might be the fastest way to get those applications going.
  2. Use administrator access (e.g. sudo) to install Locale::gettext into your new system perl, v5.18. This also somewhat hackish and not recommended because it could cause side effects with the system or stop working due to upgrades, but probably would work fine.
  3. Install your own perl as a non-administrator, install Locale::gettext to that version, and make it the default for your user-id, leaving the system perl alone. This is the best fix of the three.

Perlbrew is a great way to accomplish the latter fix. Follow these steps, and don't type "sudo" in any of them.

  • Install perlbrew, initialize it with perlbrew init, and add the "source" line as indicated to the file ~/.bash_profile, creating that file if needed.
  • Enter perlbrew available to get a list of perls. Install one of them with perlbrew install <one-of-them>. The current stable version is perl-5.20.1 which would be a good choice.
  • Now you can enter perlbrew switch <the-same-one> to make it the first in your path and the default. Type perl -v in a newly opened terminal to verify.
  • Enter perlbrew install-cpanm and then cpanm Locale::gettext and with luck the module will install without error and you'll be done.

Replies are listed 'Best First'.
Re^2: Perl version issue?
by T-Fen (Acolyte) on Oct 27, 2014 at 01:48 UTC

    Thanks. I went to check my ~/.bash_profile and saw that I already had a line there for perlbrew:

    source ~/perl5/perlbrew/etc/bashrc

    And I have the perlbrew directory containing perl v5 (which looks to be perl version 5.15):

    /Users/trey/perl5/perlbrew

    'perl -v' shows version 5.18. So would the 'recommended' fix here be to run 'perl install perl-5.20.1' followed by 'perl switch 5.20.1' to install and then use the latest version?

    It would appear that my ~/.bash_profle would remain unchanged

      'perl -v' shows version 5.18. So would the 'recommended' fix here be to run 'perl install perl-5.20.1' followed by 'perl switch 5.20.1' to install and then use the latest version?
      Yes, except that's perlbrew install ... and perlbrew switch .... You have to make sure you still have perlbrew after the upgrade to Yosemite, otherwise re-install it. The command perlbrew list should show you which perls are installed under perlbrew, and just perlbrew by itself shows a help screen when it's installed.

        Thanks. I ran the commands above to install the latest stable version of perl and now 'perl -v' shows:

        $ perl -v This is perl 5, version 20, subversion 1 (v5.20.1) built for darwin-2l +evel

        However, when I still see the following when I attempt to use t-prot with mutt to view a message:

        'Can't locate Locale/gettext.pm in @INC (you may need to install the Locale::gettext module) (@INC contains: /Library/Perl/5.12 /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/bin/t-prot line 1147.

        Looks as though it's still looking at perl version 5.18.

        Also, attempting to install Locale::gettext gives the following error (from the log):

        cpanm (App::cpanminus) 1.7014 on perl 5.020001 built for darwin-2level Work directory is /Users/trey/.cpanm/work/1414409291.13907 You have make /usr/bin/make You have /usr/local/bin/wget You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3 You have /usr/bin/unzip Searching Locale::gettext on cpanmetadb ... --> Working on Locale::gettext Fetching http://www.cpan.org/authors/id/P/PV/PVANDRY/gettext-1.05.tar. +gz -> OK Unpacking gettext-1.05.tar.gz Entering gettext-1.05 META.yml/json not found. Creating skeleton for it. Configuring gettext-1.05 Running Makefile.PL checking for gettext... no checking for gettext in -lintl...gettext function not found. Please in +stall libintl at Makefile.PL line 18. no -> N/A -> FAIL Configure failed for gettext-1.05. See /Users/trey/.cpanm/work +/1414409291.13907/build.log for details.

        How do I install the needed libintl?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1105069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2023-02-05 14:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (31 votes). Check out past polls.

    Notices?