Catalyst Couldn't load helper "Catalyst::Helper::View::TT" - perl

I follow the book "The Definitive Guide to Catalyst". Now when I run the command "script/lolcatalyst_lite_create.pl view Web TT", I get as follows
exists "/home/hengaini/LolCatalyst-Lite/script/../lib/LolCatalyst/Lite/View"
exists "/home/hengaini/LolCatalyst-Lite/script/../t"
Couldn't load helper "Catalyst::Helper::View::TT", "Can't locate Catalyst/Helper/View/TT.pm >in #INC (#INC contains: /home/hengaini/LolCatalyst-Lite/script/../lib /etc/perl /usr/local /lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at (eval 338) line 2.
question:
1.Is Catalyst still popular? Every web framework says good;
2.How to solve above problem?
Thanks!

1 - Yes, at least with me :-)
Catalyst is well maintianed. There is no new Perl framework aimed at replacing Catalyst.
2 - Install the missing module:
sudo cpan Catalyst::Helper::View::TT
Make sure everything is installed
sudo cpan Catalyst::Runtime
sudo cpan Catalyst::Devel

Yes, Catalyst is quite popular, and has a very active community behind it.
But the issue you've run into there isn't Catalyst specific. It looks like Catalyst::Helper::View::TT isn't installed on your server.
Try installing it from CPAN and see how you go. You'll also need to install Template (Template Toolkit) if you haven't already.
(If you've gotten as far as you have, I guess you know how to install from CPAN!)

Related

CPAN on Ubuntu Can't locate local/lib.pm

I just set up an Ubuntu 16.04 box and am trying to get some Perl modules installed. I launched CPAN, and it went through the automatic config procedure. At the end it dumped a few questionable messages:
Couldn't untar local-lib-2.000019.tar: 'Cannot allocate memory'
'YAML' not installed, will not store persistent state
HAARG/local-lib-2.000019.tar.gz
Had problems unarchiving. Please build manually
Can't locate local/lib.pm in #INC (you may need to install the local::lib module) (#INC contains: /home/steve/perl5/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base /home/steve/waternow) at /usr/share/perl/5.22/CPAN/FirstTime.pm line 1347.
When I restarted it, it came up with the CPAN shell command line like nothing is wrong. Did it get configured correctly, or is there something else I need to do? I'm not a Lunix noob but not an expert either.
Also are there any better options for installing Perl modules on Ubuntu besides CPAN (for example like Activestate Perl Package Manager on Windows)? I've never been too fond of CPAN because of experiences like this.

SNMPTT and perl snmp module troubleshooting

I'm on centos6.7 and i need to install snmptt to get all SNMP traps and log them into Nagios. I made it work yesterday, but today, not the same story...
I've run the yum install perl-Net-SNMP command, it told me that the package is already installed (from epel)
I've enabled the module on the snmptt.ini and now, when i'm trying to run it, I've a failed message :
root#SLINUX01:[~]$service snmptt restart
Stopping snmptt: [FAILED]
Starting snmptt: Can't locate SNMP.pm in #INC (#INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at (eval 12) line 1.
Could not load the Perl module SNMP! If net_snmp_perl_enable is
enabled then the SNMP module is required. Please see snmptt.html
for system requirements. Note: SNMPTT uses the Net-SNMP package's
SNMP module, NOT the CPAN Net::SNMP module!
died at /usr/sbin/snmptt line 426.
Suggestions ?
Found the solution : just install a different package :
yum install net-snmp-perl =/= yum install perl-Net-SNMP
The provided solution also worked for SNMPTT on Oracle Linux 7.5.
yum install net-snmp-perl
worked for me.

Cannot locate a perl module

I am trying to run a topology generation tool (http://informatique.umons.ac.be/networks/igen/) on linux where I need to install plenty of modules of perl.
For now, I have already installed CPAN. This tool requires a Statistics::Basic module which I also installed successfully.
However, after installing this module, the tool requires a package in this Statistics::Basic module. Here are the hints appeared in the command line:
Can't locate Statistics/Basic/CoVariance.pm in #INC (you may need to install the Statistics::Basic::CoVariance module) (#INC contains: /usr/local/share/perl/5.18.2/ /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .)
I get confused on this request since it is already included in the Statistics::Basic module. Even though I tried to install it independently, the cpan responded this:
cpan[1]> install Statistics::Basic::CoVariance
Warning: Cannot install Statistics::Basic::CoVariance, don't know what it is.
Does anyone know how to fix it? I am new to perl so I don't know how to make it work. Thx.
You need to replace the capital V with a small v in a couple of files and you need also some other modifications. You can find here a guide on how to make IGen-0.15 work again.

Openshift Perl dependencies not loading from .openshift/cpan.txt

I have reviewed the dependency documentation found here:
https://help.openshift.com/hc/en-us/articles/202185484-Adding-dependencies-to-applications
And reviewed the information on .openshift/cpan.txt replacing deplist.txt found here:
https://developers.openshift.com/en/perl-overview.html#_template_repository_layout
I have attempted to use the following file in both locations
File::Slurp
File::Path
File::Basename
DBI
XML::Simple
Moose
However the build does not seem to recognize these dependencies. The build does not report errors, but the cpan modules are not available.
[myapp-mydomain.rhcloud.com]\> perl -e "use File::Slurp"
Can't locate File/Slurp.pm in #INC (#INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
This is a php application with mySql and phpMyAdmin cartridges but I have not found any way to add a "Perl Cartridge" and I saw a post (can't find the link) that indicated it was not necessary as perl was available with all apps. I think I'm missing something somewhere, maybe a Perl cartridge or configuration file is necessary, or maybe headers other content needed in the cpan.txt file? The documentation indicates that the cpan.txt file should "look something like this" - but I could not find anything that gave a real file format spec.
Thanks in advance for your help.
Since you are using the PHP cartridge, you will not be able to automatically install Perl modules using the above methods. That only works on the Perl cartridge. You can try sshing into your gear and running the "perl -MCPAN -e shell" manually, but you might not have write access to the ~/.cpan directory on your gear, so that may not work either. If you can provide more information about what you are trying to do someone might have a suggested solution.

Using CPAN to install Dancer and dependencies

I am trying to create a sample web service using Dancer. I am using Ubuntu 10.04 as my OS. I installed Dancer and dependencies using CPAN client and can also do
dancer -a MyApp
However, when I try to run the app.pl file, the code throws an error saying YAML.pm not found. I am sure this file was downloaded when the dependencies were installed. A have a few questions :-
1. Where does CPAN put all these files which were downloaded? How are they included in the #INC?
2. For using Dancer, do I have to manually include all the files in #INC?
I tried to create a very simple perl dancer app the says hello world by including the Dancer.pm path in #INC. However, it keeps failing because of some or the other dependency missing.
Help me in understanding what am I doing wrong?
cpan should put files in one of the path from #INC
perl -E '$"="\n"; say "#INC"'
Output on my system:
/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl
.
And cpan puts files in /usr/local/share/perl/5.14.2
Because this path exists in #INC you shouldn't include it manually. And what about Dancer, YAML is not hard dependency for it, because of this it wasn't installed.