2

Facing below issue when execute catalyst server script.

Couldn't load class (Catalyst::Script::Server) because: "ensure_class_loaded" is not exported by the Catalyst::Utils module
Can't continue after import errors at /opt/madhan/lib/perl5/Catalyst/ScriptRole.pm line 7.
BEGIN failed--compilation aborted at /opt/madhan/lib/perl5/Catalyst/ScriptRole.pm line 7.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Module/Runtime.pm line 313.
Compilation failed in require at /opt/madhan/lib/perl5/Catalyst/ScriptRunner.pm line 13.
        Catalyst::ScriptRunner::find_script_class("Catalyst::ScriptRunner", "testsite", "Server") called at /opt/madhan/lib/perl5/Catalyst/ScriptRunner.pm line 42
        Catalyst::ScriptRunner::run("Catalyst::ScriptRunner", "testsite", "Server") called at /opt/madhan/testsite/script/testsite_server.pl line 8

Will the perl 5.8.8 support Catalyst MVC?

melpomene
  • 84,125
  • 8
  • 85
  • 148
Madhan
  • 1,291
  • 3
  • 21
  • 34
  • 3
    It *should* work — I believe this is a bug and I'm talking to the maintainers about it. But you realize that 5.8.8 is over a decade old? – hobbs Mar 19 '17 at 05:26
  • What version of Catalyst are you using? (`perl -MCatalyst -le'print $Catalyst::VERSION'`) – ikegami Mar 19 '17 at 06:38
  • 2
    Perl is supported 2 versions backward. Today the last released is 5.24.1, so the supported is 5.20+ :). I understand that some vendors (especially RedHat) in some long-supported distros uses 5.8.8 - but it is really time for the upgrade, especially for web-env, where the easy unicode processing is mandatory these days... Using [plenv](https://github.com/tokuhirom/plenv) or [anyenv](https://github.com/riywo/anyenv) is really easy. (just IMHO though). – clt60 Mar 19 '17 at 08:36
  • Catalyst Version is : 5.90114 – Madhan Mar 20 '17 at 04:30

1 Answers1

6

This is a bug in Catalyst. There was some type-checking code in Catalyst::ScriptRole (since 2012!) which was completely broken, but the brokenness was only visible in particular circumstances — namely, if a script provided a loader_class to Catalyst::ScriptRole that wasn't already a loaded class (likely no one ever has), or if the system has a very old version of UNIVERSAL.pm such as that shipped with perl 5.8. It's this second case that you're running into.

I've pushed a patch to Catalyst-Runtime to resolve this problem; hopefully it will be released soon it's included in Catalyst-Runtime 5.90115.

hobbs
  • 223,387
  • 19
  • 210
  • 288