Home » APIs » Howto: Unable to start Catalyst web applications using the built in development server? We have the answer

Howto: Unable to start Catalyst web applications using the built in development server? We have the answer

If you’re getting the “Can’t locate Catalyst/Engine/HTTP/Restarter.pm” error message, it is very likely you’re running a recent version of Catalyst:

script/lolcatalyst_lite_server.pl -r
Can't locate Catalyst/Engine/HTTP/Restarter.pm in @INC (@INC contains: /home/jason/catalyst-book-code/Chapter_3/LolCatalyst-Lite/script/../lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .). at /usr/lib/perl5/Class/MOP.pm line 116
        Class::MOP::load_first_existing_class('Catalyst::Engine::HTTP::Restarter') called at /usr/lib/perl5/Class/MOP.pm line 121
        Class::MOP::load_class('Catalyst::Engine::HTTP::Restarter') called at /usr/share/perl5/Catalyst.pm line 2634
        Catalyst::setup_engine('LolCatalyst::Lite', undef) called at /usr/share/perl5/Catalyst.pm line 1081
        Catalyst::setup('LolCatalyst::Lite') called at /home/jason/catalyst-book-code/Chapter_3/LolCatalyst-Lite/script/../lib/LolCatalyst/Lite.pm line 34
        require LolCatalyst/Lite.pm called at script/lolcatalyst_lite_server.pl line 55
Compilation failed in require at script/lolcatalyst_lite_server.pl line 55.

The problem is that Catalyst::Engine::HTTP::Restarter within Catalyst::Engine was replaced by Catalyst::Restarter within the Catalyst::Devel package. How to fix your application to use the updated development web server? Very easy. Rerun catalyst.pl with the “-scripts”, to rebuild just the scripts in the script directory, and “-force” to overwrite any files therein:

catalyst.pl -scripts -force LolCatalyst::Lite
 exists "LolCatalyst-Lite/script/lolcatalyst_lite_cgi.pl"
created "LolCatalyst-Lite/script/lolcatalyst_lite_cgi.pl"
 exists "LolCatalyst-Lite/script/lolcatalyst_lite_fastcgi.pl"
created "LolCatalyst-Lite/script/lolcatalyst_lite_fastcgi.pl"
 exists "LolCatalyst-Lite/script/lolcatalyst_lite_server.pl"
created "LolCatalyst-Lite/script/lolcatalyst_lite_server.pl"
 exists "LolCatalyst-Lite/script/lolcatalyst_lite_test.pl"
created "LolCatalyst-Lite/script/lolcatalyst_lite_test.pl"
 exists "LolCatalyst-Lite/script/lolcatalyst_lite_create.pl"
created "LolCatalyst-Lite/script/lolcatalyst_lite_create.pl"

If you’re interested in learning the Catalyst Web Framework (Perl based), I highly recommend The Definitive Guide to Catalyst: Writing Extensible, Scalable and Maintainable Perl–Based Web Applications.

Share Button

Comments

  1. s60v5 says:

    i was running into that problem from quite a long time, hope this solution will work. will try and post the response here.

  2. Phil Medes says:

    I wanted to start using Catalyst using Stawberry Perl on Vista. I tried installing the framework using cpan. After I was done with the installation, I tried runing from the Commandline: “catalyst.pl MyAPP”. Instead of creating a new application, it just displayed the helpl message! Now I have no clue what to do. I don’t know how to uninstall Catalyst, so I can’t try reinstalling it.

  3. Phil Medes says:

    I used the batch file, catalyst.bat, instead and it worked. Apparently the book was wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Facebook login by WP-FB-AutoConnect