Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Struggling in installaion of any module in Perl which is installed using perlbrew

by phoenix007 (Sexton)
on Oct 29, 2018 at 07:07 UTC ( #1224819=perlquestion: print w/replies, xml ) Need Help??

phoenix007 has asked for the wisdom of the Perl Monks concerning the following question:

How to install cpan module on specific Perl installation and on system default Perl ?

This is my first question here

Currently I am working on Ubuntu flavor of linux OS. I have default 5.26.1 version of Perl pre-installed. Output of perl -v command copy pasted below

This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi

I have installed perl-5.8.9 using perlbrew and installed CPAN client cpanm. Now I am trying to install File::Find::Rule module then I am getting output mentioned below. Here I am not getting where this module got installed and how I can control module installation must be done in specific Perl installation

! ! Can't write to /usr/local/share/perl/5.26.1 and /usr/local/bin: Inst +alling modules to /home/kshitij/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/perl/5.26.1 and /usr/local/bin) ! - Configure local::lib in your existing shell to set PERL_MM_OPT e +tc. ! - Install local::lib by running the following commands ! ! cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/per +l5/lib/perl5/ -Mlocal::lib) ! --> Working on File::Find::Rule Fetching http://www.cpan.org/authors/id/R/RC/RCLAMP/File-Find-Rule-0.3 +4.tar.gz ... OK Configuring File-Find-Rule-0.34 ... OK ==> Found dependencies: Number::Compare, Text::Glob --> Working on Number::Compare Fetching http://www.cpan.org/authors/id/R/RC/RCLAMP/Number-Compare-0.0 +3.tar.gz ... OK Configuring Number-Compare-0.03 ... OK Building and testing Number-Compare-0.03 ... OK Successfully installed Number-Compare-0.03 --> Working on Text::Glob Fetching http://www.cpan.org/authors/id/R/RC/RCLAMP/Text-Glob-0.11.tar +.gz ... OK Configuring Text-Glob-0.11 ... OK Building and testing Text-Glob-0.11 ... OK Successfully installed Text-Glob-0.11 Building and testing File-Find-Rule-0.34 ... OK Successfully installed File-Find-Rule-0.34 3 distributions installed

I have also tried switching Perl using perlbrew. Note : when I hit command perlbrew list it only lists perl-5.8.9

Replies are listed 'Best First'.
Re: Struggling in installaion of any module in Perl which is installed using perlbrew
by marto (Cardinal) on Oct 29, 2018 at 09:30 UTC

    Did you complete the perlbrew setup as instructed?

    marto@Shemp:~$ perlbrew init perlbrew root (~/perl5/perlbrew) is initialized. Append the following piece of code to the end of your ~/.profile and s +tart a new shell, perlbrew should be up and fully functional from there: source ~/perl5/perlbrew/etc/bashrc Simply run `perlbrew` for usage details. Happy brewing!

    The two important steps here are to edit the profile and start a new shell. From past experience if you don't do this you may see unexpected things happening.

      Can't write to /usr/local/share/perl/5.26.1 and /usr/local/bin
      Did you complete the perlbrew setup as instructed?

      That seems to be the likely explanation. phoenix007: In addition to adding source ~/perl5/perlbrew/etc/bashrc to your ~/.bashrc file and logging out and back in again, make sure you either perlbrew use perl-5.8.9 (for the current shell only), or perlbrew switch perl-5.8.9 (make it the default for this and all future shells; I wouldn't recommend this though because 5.8.9 is quite old).

        Thanks haukex. perlbrew use perl-5.8.9 served my purpose of installing module to 5.8.9

      Thanks for help marto I have already done proper perlbrew setup

Re: Struggling in installaion of any module in Perl which is installed using perlbrew
by Haarg (Curate) on Oct 29, 2018 at 11:12 UTC
    The cpanm command you are using may be tied to system perl. Try running the command perlbrew install-cpanm to install one that will work properly with perlbrew.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1224819]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2021-10-15 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (69 votes). Check out past polls.

    Notices?