Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: @INC not providing path to modules

by perlfan (Curate)
on Jun 22, 2016 at 20:05 UTC ( #1166299=note: print w/replies, xml ) Need Help??


in reply to @INC not providing path to modules

Are you sure you're using the perl you're expecting?

It seems like the message, "Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/grunt103/perl5," indicates that you were using system the cpanm installed via system perl to install Moose as an unprivileged user. In any case, you're environment is not what you're expecting it to be.

Look at the output of which perl and perlbrew list;

Replies are listed 'Best First'.
Re^2: @INC not providing path to modules
by Anonymous Monk on Jun 23, 2016 at 11:23 UTC

    Hi perlfan

    I was using perlbrew's cpanm installer which was installed within the /home/grunt103 directory and it should have been using perl-5.20.3 also installed within the /home/grunt103 directory. I was not surprised by the message as grunt103 would not have had permission to write to the directories outside of it's domain.

    I have pasted the full message below in case there is something in there I have missed.

    ! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/grunt103/perl5
    ! To turn off this warning, you have to do one of the following:
    ! - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
    ! - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
    ! - Install local::lib by running the following commands
    !
    ! cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

    I have copied Moose.pm to /home/grunt103/perl5 and the script can find Moose so I might uninstall all the modules and use local::lib to install them all into /home/grunt103/perl5

    Thanks for your feedback.

      If you don't want to see that message, I recommend following the instructions in it:

      Configure local::lib in your existing shell to set PERL_MM_OPT etc.

      I think that local::lib has lots (and lots) of documentation on how to configure it properly for perlbrew etc.

        Thanks Corion, I think that is the route I will take.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-05-31 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?