Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Using Perlbrew macOS impossible to install distributions

by Anonymous Monk
on Nov 28, 2017 at 08:35 UTC ( #1204396=note: print w/replies, xml ) Need Help??


in reply to Re: Using Perlbrew macOS impossible to install distributions
in thread Using Perlbrew macOS impossible to install distributions

Maybe you can solve my next problem too. If I want to install a new module, it fails saying that there is no permission to write in target folder. I do not see any special setting in my osMac that should prevent it. perl -v confirms I am working with the Perl version installed with Perlbrew.

ADs-MacBook-Air:Desktop ad$ cpan Lingua-EN-Tagger Loading internal null logger. Install Log::Log4perl for logging messag +es Reading '/Users/ad/.cpan/Metadata' Database was generated on Sat, 25 Nov 2017 17:53:48 GMT Warning: You are not allowed to write into directory "/Users/ad/.cpan/ +sources/authors". I'll continue, but if you encounter problems, they may be due to insufficient permissions. Fetching with HTTP::Tiny: http://cpan.metacpan.org/authors/01mailrc.txt.gz Error downloading with HTTP::Tiny: Error: Could not create temporary f +ile /Users/fc/.cpan/sources/authors/01mailrc.txt.gz.tmp47408338328566 + for downloading: Permission denied at /Users/fc/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/CPAN/HTTP/Cl +ient.pm line 41.

Replies are listed 'Best First'.
Re^3: Using Perlbrew macOS impossible to install distributions
by kevbot (Priest) on Nov 28, 2017 at 09:09 UTC

    This output looks strange to me. It appears that there are two different user accounts involved (/Users/ad and /Users/fc). It appears that you are trying to run the cpan command when you are logged into the ad account, but you installed the brewed perl in the fc account. Is that the case? I always use brewed perls from the same account that I used to install them. Try to confirm that you are using the cpan executable from your brewed perl. Typing this at the command line,

    which cpan
    should give you output like this,
    /Users/fc/perl5/perlbrew/perls/perl-5.26.1/bin/cpan

    If the output is /usr/bin/cpan, then you are still using the cpan command that is part of the system perl. After you installed perl-5.26.1 did you switch to it with the following command?

    perlbrew switch perl-5.26.1
    If you did not run the switch command then you are still using the system perl (which is probably not what you want).

    Once you confirm that you are using your brewed perl, I recommend that you install cpanminus (see App::cpanminus) using the following command,

    curl -L https://cpanmin.us | perl - App::cpanminus
    Then you can use cpanm to install modules (I find that its easier to use than the older cpan command).

      My error: I just erroneously changed fc->ad when I was editing my post (sorry). I was using the correct perl and can was the one supposed to be

      Again, your suggestion saved my day. After installing cpanminus I can install the modules like a breeze. THANK YOU

Re^3: Using Perlbrew macOS impossible to install distributions
by haukex (Archbishop) on Nov 28, 2017 at 09:32 UTC

    Just one more comment in addition to kevbot's excellent post:

    You are not allowed to write into directory "/Users/ad/.cpan/sources/authors"

    This can also mean that a user other than ad has been working in that directory, for example if one has done sudo cpan in the past. If you still have the permissions problem after you've sorted out the confusion with the /Users/ad vs. /Users/fc, the simplest thing (although it'll cause a bit of re-downloading) is probably just to clobber the entire .cpan directory, making sure to back up the configuration file if you have set up a custom configuration. You may have to do sudo rm, but of course be very careful with this command!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2022-11-30 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?