Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
First, some background.

I had a lot of trouble installing a Catalyst/DBIC development environment. I have left various crumbs of angst (* check the wiki history :) ) around the monastery and the catalyst wiki, begging for help on how to do this and not really getting a satisfactory answer.

To be fair, the base catalyst install alone was clean -- I think there's been a lot of work getting this into a state where it can be easily installed from CPAN recently. But cpen -i Catalyst won't get you far. To get the most leverage, you need DBIC, and various DBIC helpers, and various Catalyst helpers. These tend to be on the bleeding edge of CPAN, and to have dependencies that are even more bleeding edge than they are.

These won't install without the occasional force, as root.

And as non-root, I had constant cronic problems involving warnings telling me this was not doable without sudo, that directory wasn't writable... and this even after hours of experimentation with variations on the suggestions in nodes such as

A detailed How-To for locally installing modules,

and catalyst propaganda such as

Catalyst on Shared Hosting (advent calendar)

The usual advice is to configure some combination of PERL5LIB/PREFIX/LIBS/UNINST/choose your poison, and when the magic env vars are set, everything will "just work". This is probably true for simple installs that don't have a lot of dependencies. But it's not true at the bleeding edge of CPAN. At the bleeding edge of CPAN, install don't "just work" as advertised.

Why not? I haven't really tracked down the root cause, but for a small whiff of what I suspect is a very big pile of stink, have a look at What are the "prefix" and "lib" arguments to used for? and then the c.p.l.m thread mentioned by tinita. Over my head but in any case... uh oh.

Passing on, when I finally got all my goodies installed (as root), I had this nagging worry that I wouldn't be able to reliably recreate the my development environment without a lot of manual trial and error. Of course I could just tar up my perl install, but that didn't feel clean.

With all this drama, I was slowly started to get the feeling I would have to become a CPAN ninja to feel safe using catalyst, and that this was not a good thing.

Well, in this case, it seems that light at the end of tunnel was not a train. Or, if it was a train, it still hasn't run me over :)

The solution -- the right solution, the one that feels clean to me -- was to install a local version of perl, configure my environment to use that in an intuitive way, and then maintain a perl script for the cpan install, that installs everything in the right order. The install script is under active development, constantly being tweaked, and the tweaks are being tracked in version control.

This feels right.

Works for root, works for non root. And as root, the nice thing is that if my perl gets borked for some reason, or I just need to start over, it's easy. Delete perl, recompile perl locally, and run the install script.

Finally, here is my recipe for installing perl locally on a freshly installed Debian. FWIW, this was for Debian 3.01 on my virgin tektonic VPS.

as root: ( apt-get -y update apt-get -y upgrade apt-get -y install libc6-dev apt-get -y install gcc apt-get -y install emacs21 apt-get -y install subversion apt-get -y install postgresql ) <p> then, adduser thartman <p> then, as thartman: <p> ( wget +r.gz tar -xzvf perl-5.8.8.tar.gz cd perl-5.8.8 sh Configure -Dprefix=/home/thartman/perlroot/perl -des #make this you +r home directory make test make install mkdir -p ~/usr/local #used for template toolkit installation ) | tee perlinstall.out ( cat >> ~/.bashrc export $PATH=~/home/thartman/perlroot/perl/bin:$PATH export FTP_PASSIVE=1 ) cpan, manual configuration? no o conf prerequisites_policy follow o conf commit install cpan (i.e., upgrade CPAN)

Now, obviously the apt-get lines still require root, but I still think this is a huge improvement. And maybe there's some way to apt-get as a non-root, I don't know, I'm still learning my way around debian.

But at any rate, this is the constellation that has brought me peace of mind with catalyst and, I suspect, moving forward, peace of mind with a variety of non-plain-vanilla perl contexts.

Hope this helps!

Note: I was partly inspired to write this when I came across Catalyst: Compile your own perl in your home directory and don't worry about it.

Also of interest might be my bookmarks at perl clean install

UPDATE: Matt trout has recently updated the shared hosting with dreamhost bit of the catalyst wiki, and said that he done this enough times that he is convinced it works.

I haven't tried the updated instructions yet.

UPDATE 2: Just in case it helps someone, here is my "constantly under development script, This is nothing special; it just uses cpan through perl to get things installed in the correct order and minimize complaining about missing dependencies.

My guiding principle is, given a virgin debian server (eg a VPS box I could buy without hassle and for pennies a day), configure perl + cata environment in under an hour. This is harder than it sounds, but doable.

#!/home/thartman/perlroot/perl/bin/perl use strict; use warnings; use CPAN; # Htmlwidget: # test for Net::DNS::Resolver::Recurse fails on tektonic VPS # same as reported in +/341522 # but we go ahead and use this module anyway force('install', 'Net::DNS'); install('HTML::Widget'); #goto Digestcolumns; for my $mod qw( Catalyst::Plugin::ConfigLoader Catalyst::Plugin::Session::State::Cookie Catalyst::Plugin::Static::Simple Catalyst::Plugin::StackTrace Catalyst::Plugin::Authentication Catalyst::Plugin::Authentication::Store::DBIC Catalyst::Plugin::Authentication::Credential::Password Catalyst::Plugin::Authorization::Roles Catalyst::Plugin::Authorization::ACL Catalyst::Plugin::Session Catalyst::Plugin::Session::Store::FastMmap HTML::Widget Catalyst::Plugin::HTML::Widget Catalyst::View::TT Algorithm::C3 Class::C3 DBIx::Class Catalyst::Model::DBIC::Schema Lingua::EN::Inflect::Number Catalyst::Action::RenderView DBD::Pg ) { if ( my $result = install ($mod) ) { die "couldn't instal: $mod, result: $result"; } #print "result: $result"; #die;#die "couldn't install: $mod"; } Digestcolumns: #install ('XML::XPath'); install ('IO::Scalar'); install ('Text::RecordParser'); install ('SQL::Translator'); force ( 'install', 'DBIx::Class::DigestColumns'); die; Cpanplus: install ('Bundle::CPANPLUS::Dependencies'); install ('Module::Loaded'); install ('Package::Constants'); install ('Test::Harness'); install ('CPANPLUS'); # Module::Signature causes headache, see list posts. system('rm -f /usr/lib/perl5/site_perl/5.8.8/Module/'); die;

In reply to Install Perl Locally -- If this works for Catalyst, it'll work for anything! by tphyahoo

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (7)
    As of 2014-11-26 09:14 GMT
    Find Nodes?
      Voting Booth?

      My preferred Perl binaries come from:

      Results (165 votes), past polls