Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Update on setting up a PAUSE testing environment

by hsmyers (Canon)
on May 16, 2011 at 03:44 UTC ( [id://905012]=perlquestion: print w/replies, xml ) Need Help??

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

I was hoping I'd be able to write this up as a how-to, but not yet. Here is where things are at the moment:
  • Ubuntu installed
  • perlbrew installed
  • appended source ~/perl5/perlbrew/etc/bashrc to .bashrc
  • installed perl 5.8.1
  • cpanm installed for desired version of perl
  • dependencies installed
  • module to be debugged downloaded
And at this point I bounced off of a brick wall. Even though I was careful to issue perlbrew use perl-5.8.1 and then used perlbrew install-cpanm before using cpanm to install the dependencies, running perl Makefile.PL politely told me that none of them were there or that they were not current etc. At that point I did:
$which cpanm /home/hsmyers/perl5/perlbrew/bin/cpanm
which certainly looked correct. Just to check, I rebooted and before switching perls, I again did:
$which cpanm /home/hsmyers/perl5/perlbrew/bin/cpanm
which did not look alright. Clearly cpanm is not correctly installed at least in terms of where it is placing modules. From what I had read, I was expecting a pretty much seamless fit between cpanm and perlbrew---at a guess I was wrong. Given how little I know about Linux it is entirely possible that I've taken something the rest of you take for granted and found yet another way to screw it up (YAWTSIU) ---regardless, I'm more or less stuck at this point. Suggests and tips as usual appreciated...

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Replies are listed 'Best First'.
Re: Update on setting up a PAUSE testing environment
by ikegami (Patriarch) on May 16, 2011 at 06:20 UTC

    which did not look alright. Clearly cpanm is not correctly installed at least in terms of where it is placing modules.

    Looks right to me. You should find /home/hsmyers/perl5/perlbrew/bin/cpanm to be a link to the current selected perl.

    [~/usr/perlbrew/bin]$ dir lrwxrwxrwx ... a2p -> ~/usr/perlbrew/perls/current/bin/a2p* lrwxrwxrwx ... c2ph -> ~/usr/perlbrew/perls/current/bin/c2ph* lrwxrwxrwx ... corelist -> ~/usr/perlbrew/perls/current/bin/corelist* lrwxrwxrwx ... cpan -> ~/usr/perlbrew/perls/current/bin/cpan* ...
    [~/usr/perlbrew/perls]$ dir lrwxrwxrwx ... current -> perl-5.12.3/ ...

      Shouldn't it point to the original cpanm? Since after the reboot I'm no longer running 5.8.1? Color me confused... I will check what you've posted to see what it shows though.

      Update: Here is what I get:
      hsmyers@ubuntu:~$ cd /usr/perlbrew/perls bash: cd: /usr/perlbrew/perls: No such file or directory hsmyers@ubuntu:~$ cd ~/usr/perlbrew/perls bash: cd: /home/hsmyers/usr/perlbrew/perls: No such file or directory hsmyers@ubuntu:~$ cd /usr hsmyers@ubuntu:/usr$ cd perlbrew bash: cd: perlbrew: No such file or directory

      --hsm

      "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

        Shouldn't it point to the original cpanm?

        It should point to the cpanm installed by the Perl installation you indicated you wanted to use via perlbrew switch.

        Are you saying it doesn't?

        Here is what I get:

        That's not the file which said you were using.

Re: Update on setting up a PAUSE testing environment
by Anonymous Monk on May 16, 2011 at 04:53 UTC
    I'd love to help you with perlbrew, but I find it too complicated, for simple debug, try perl -V or perl -e " die $^X "

    This works for me

    download, make, install, perl 5.8.1
    wget -c http://cpan.org/src/perl-5.8.1.tar.gz tar -zxvf perl-5.8.1.tar.gz cd perl-5.8.1 ./Configure -des -Dprefix=~/p/5.8.1/ make install
    use this perl by making it first in path
    export PATH=~/p/5.8.1/perl/bin:$PATH
    verify path
    which perl perl -V perl -e "die $^X"
    verify path from cpanp
    $ cpanp CPANPLUS::Shell::Default -- CPAN exploration and module installation ( +v0.9105) CPAN Terminal> !warn $^X
Re: Update on setting up a PAUSE testing environment
by ikegami (Patriarch) on May 16, 2011 at 18:54 UTC

    You didn't ask a question. Are you asking how to use the cpanm installed by /usr/bin/perl? If so,

    perlbrew switch /usr/bin/perl hash -r cpanm
      You are right, I tend to treat questions like some treat documentation (but it's self-evident... :) ), I shouldn't but I do. This is the third way that I've see to install cpanm, but you I trust! I'll give it a shot and see what happens. Still wish I didn't have the knack of turning speed-bumps into climbing walls...

      Update: Clearly I don't understand what you've said. I tried the following:

      hsmyers@ubuntu:/usr$ perlbrew switch /usr/bin/perl /usr/bin/perl is not installed hsmyers@ubuntu:/usr$ which cpanm /home/hsmyers/perl5/perlbrew/bin/cpanm hsmyers@ubuntu:/usr$ sudo cpanm Chess::PGN::Moves [sudo] password for hsmyers: Chess::PGN::Moves is up to date. (0.05) hsmyers@ubuntu:/usr$ hash -r hsmyers@ubuntu:/usr$ cpanm Can't write to cpanm home '/home/hsmyers/.cpanm': You should fix it wi +th chown/chmod first. hsmyers@ubuntu:/usr$ sudo cpanm Usage: cpanm [options] Module [...] Try `cpanm --help` or `man cpanm` for more options. hsmyers@ubuntu:/usr$ hash -r hsmyers@ubuntu:/usr$ sudo cpanm Usage: cpanm [options] Module [...] Try `cpanm --help` or `man cpanm` for more options.
      With the results as shown. Maybe I wasn't clear (the not asking questions thing) what I need is a cpanm that works with perlbrew. What I have now is one that only installs in the original environment. As a for instance, the attempt to install Chess::PGN::Moves shows a reference to the one installed under 5.10, not to one installed under 5.8.1. Further, the first line is as you had shown and got the result that you see. If I now do a quick test:
      hsmyers@ubuntu:/usr$ perldoc Chess::PGN::Moves No documentation found for "Chess::PGN::Moves".
      This shows that no attempt to use cpanm has yet worked in the 5.8.1 context. Since I have no idea of what any of the commands you showed mean, I have no idea of what might be wrong---clearly something is. Given the lack of any directory off of /usr/ named perlbrew, I wonder about my installation of perlbrew---did I mess it up somehow? The only thing that I have that matches what you've said is that I do have a /usr/bin/perl. Being curious I did:
      hsmyers@ubuntu:/$ perlbrew list perl-5.8.1 * /usr/bin/perl (5.10.1)
      The documentation didn't say what the '*' stands for, but if I do:
      hsmyers@ubuntu:/$ perlbrew install /usr/bin/perl Unknown installation target "/usr/bin/perl", abort. Please see `perlbrew help` for the insturction of install command.
      This might explain why my attempt to perlbrew switch /usr/bin/perl didn't work.

      The more I look at your first post, the more I'm wondering why I don't have a /usr/perlbrew/ directory. After all if I screwed up cpanm to to point of non-usability, doing the same to perlbrew should be dead bang easy...

      IMPORTANT Update: Found the problem or at least found something that works (can't speak to its correctness beyond that) Did this:
      1. Removed cpanm as installed by perlbrew
      2. Removed cpanm as installed by cpan
      3. Reinstalled cpanm using perlbrew install-cpanm
      4. Issued magic incantation sudo chown -R hsmyers /home/hsmyers/.cpanm
      5. Tested by cpanm-ing first dependency and rerunning perl Makefile.PL---still have dependencies reported, but one less than before!
      6. Continued with installs and final testing with a clean result from the makefile
      Like I said, since I don't even have a Linux merit badge, let alone a wizard's staff, this is slightly suspect. I think that removing the original cpanm was probably unnecessary but did so as a clean slate kind of thing. I am convinced that the problem came down to the simple lack of correct ownership for the .cpanm directory, probably nothing more than that. This matches well with the countless reports on the net about how easy all of this was supposed to be---it's always easy if you know what the hell you are doing!.

      As per usual, a ton of thanks to all who helped and made offers of help—you and all of the other Monks make this place the incredible resource that it is!

      --hsm

      "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-03-19 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found