Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

using cpanm with perlbrew

by nbezzala (Scribe)
on Jan 25, 2014 at 05:52 UTC ( [id://1072037]=perlquestion: print w/replies, xml ) Need Help??

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

---Solved--- Hello Monks,
bash-4.2$ which cpanm /usr/bin/cpanm bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl bash-4.2$ cpanm Moo Moo is up to date. (1.004002) bash-4.2$ duckpan DDGC::Static Can't locate Moo.pm in @INC (@INC contains: /home/nitishb/perl5/lib/pe +rl5 /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16 +.3/x86_64-linux /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/lib/si +te_perl/5.16.3 /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/lib/5.1 +6.3/x86_64-linux /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/lib/5 +.16.3 .) at /home/nitishb/perl5/lib/perl5/App/DuckPAN.pm line 11. BEGIN failed--compilation aborted at /home/nitishb/perl5/lib/perl5/App +/DuckPAN.pm line 11. Compilation failed in require at /usr/local/bin/duckpan line 16. BEGIN failed--compilation aborted at /usr/local/bin/duckpan line 16. bash-4.2$ which duckpan /home/nitishb/perl5/bin/duckpan
I have Moo in these places
/usr/local/lib/perl/5.14.2/auto/Moo /usr/local/share/perl/5.14.2/Moo

Please let me know how I should go about fixing this.

Thanks, Nitish

Replies are listed 'Best First'.
Re: using cpanm with perlbrew
by kevbot (Vicar) on Jan 25, 2014 at 06:22 UTC

    It seems that you have cpanm installed into your system perl, and not your perlbrew perl.

    Do you have cpanm installed in your perlbrew perl, e.g. /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/cpanm?

    If you don't find cpanm there, then I recommend you confirm that you are using your perlbrew perl:

    bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl

    Then install cpanm using the following (this is taken directly from the App::cpanminus instructions):

    curl -L http://cpanmin.us | perl - App::cpanminus
    Then, confirm that you are using the cpanm that was installed to your perlbrew perl:
    bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/cpanm
    Then install Moo using cpanm:
    cpanm Moo
    You may also need to install App::DuckPAN into your perlbrew perl:
    cpanm App::DuckPAN
    I hope this helps.
      Thanks kevbot, I tried it, but its still the same
      bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl bash-4.2$ curl -L http://cpanmin.us | perl - App::cpanminus % Total % Received % Xferd Average Speed Time Time Time + Current Dload Upload Total Spent Left + Speed 100 303 0 303 0 0 258 0 --:--:-- 0:00:01 --:--: +-- 1561 100 262k 100 262k 0 0 72406 0 0:00:03 0:00:03 --:--: +-- 215k --> Working on App::cpanminus Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1. +7001.tar.gz ... OK Configuring App-cpanminus-1.7001 ... OK Building and testing App-cpanminus-1.7001 ... OK Successfully installed App-cpanminus-1.7001 1 distribution installed bash-4.2$ which cpanm /home/nitishb/perl5/bin/cpanm bash-4.2$ which perl /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl bash-4.2$ cpanm Moo Moo is up to date. (1.004002) bash-4.2$ cpanm App::DuckPAN App::DuckPAN is up to date. (0.135) bash-4.2$ duckpan DDGC::Static Can't locate Moo.pm in @INC (@INC contains: /home/nitishb/perl5/lib/pe +rl5/x86_64-linux /home/nitishb/perl5/lib/perl5 /home/nitishb/perl5/pe +rlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux /home/niti +shb/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3 /home/nitis +hb/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux /home/nit +ishb/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3 .) at /home/nitishb/ +perl5/lib/perl5/App/DuckPAN.pm line 11. BEGIN failed--compilation aborted at /home/nitishb/perl5/lib/perl5/App +/DuckPAN.pm line 11. Compilation failed in require at /usr/local/bin/duckpan line 16. BEGIN failed--compilation aborted at /usr/local/bin/duckpan line 16. bash-4.2$

        Maybe your $ENV{PATH} is messed up or you have aliased perl to /home/nitishb/perl5/perlbrew/perls/perl-5.16.3/bin/perl.

        You will need to debug your shell setup and find out why invoking Perl as perl does not seem to use the correct Perl. Personally, I prefer to use absolute paths instead to choose the correct Perl. Maybe try:

        curl -L http://cpanmin.us | /home/nitishb/perl5/perlbrew/perls/perl-5. +16.3/bin/perl - App::cpanminus

        Without seeing your environment, there is very little to be done otherwise.

Re: using cpanm with perlbrew
by tobyink (Canon) on Jan 26, 2014 at 08:23 UTC

    To install a copy of cpanm in a place where all your perlbrew Perls can use it, run:

    perlbrew install-cpanm
    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
Re: using cpanm with perlbrew
by wjw (Priest) on Jan 26, 2014 at 00:05 UTC
    Check that your .bashrc has the following line in it:

    source ~/perl5/perlbrew/etc/bashrc

    (adjust for your own install path)

    I had some issues before I re-read the perldocs and inserted the above in my ~/.bashrc

    Best of luck...

    ...the majority is always wrong, and always the last to know about it...
    Insanity: Doing the same thing over and over again and expecting different results.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found