Catalyst on Windows with Strawberry Perl

The Catalyst Framework is an elegant Model-View-Controller based web framework for Perl, with similarities to Ruby on Rails. It is a popular choice for Web 2.0 applications based on Perl, speeding up and simplifying development.

Catalyst is very nice to use, but has a reputation of being hard to use, particularly on Windows. Windows has historically been regarded as the “outcast” of Perl development environments—the lack of proper build tools had made installing most modules (including Catalyst) difficult, to say the least. ActiveState’s binary PPM packages are hard to find and often outdated. The effect has been that the complex dependencies of Catalyst were nearly impossible for the average mortal to manage on Windows.

I recently discovered Strawberry Perl, which has made building modules on Windows easier than ever. It includes a bundled MinGW toolchain for compiling and pure-Perl equivalents for other necessary tools. Now, it is no longer necessary to install Visual Studio or Dev-C++ just to build Perl modules. Using the CPAN installer from the command line Just Works.

If you have tried to install Catalyst on Windows before, you’ll know that hunting for PPMs and building the missing modules takes hours and leaves you with an installation that isn’t up-to-date. With Strawberry Perl, I was able to install the newest Catalyst fresh from CPAN in about 10 minutes.

  1. Download Strawberry Perl and install it.
  2. Download the Shadowcat cat-install script.
  3. Open the script in your favorite text editor, and delete the entire block starting with if ($^O eq 'MSWin32') {, which contains a bunch of ppm install commands. Strawberry Perl makes this unnecessary.
  4. Open a command prompt, cd to the directory where you saved the script, and type perl cat-install. Wait a few minutes as all the dependencies of Catalyst are installed.
  5. That’s it! Everything worked for me without a hitch. You can run the script again to be sure that everything went okay; it should say that “Catalyst is up to date.”

This installs a basic runtime environment, but if you want to develop on the system, you will probably want to install some more modules. Add these lines to the cat-install script and run it again.

install('ExtUtils::ParseXS');
install('Digest::SHA1');
install('Digest::SHA');
install('DBIx::Class');
install('DBIx::Class::HTMLWidget');
install('Module::ScanDeps');
install('Module::CoreList');
install('PAR::Dist');
install('Archive::Tar');
install('Module::Install');
install('Catalyst::Devel');
install('Catalyst::Plugin::ConfigLoader');
install('Catalyst::Plugin::Session');
install('Catalyst::Plugin::Session::State::Cookie');
install('Catalyst::Plugin::Session::Store::File');
install('Catalyst::Plugin::Authorization::ACL');
install('Catalyst::Plugin::Authentication');
install('Catalyst::Plugin::Authorization::Roles');
install('Catalyst::Plugin::Authentication::Store::DBIC');
install('Catalyst::Plugin::DefaultEnd');
install('Catalyst::Plugin::StackTrace');
install('Catalyst::Plugin::Dumper');
install('Catalyst::Plugin::HTML::Widget');
install('Catalyst::Model::DBIC::Schema');
install('Catalyst::View::TT');
install('Test::WWW::Mechanize');
install('Test::WWW::Mechanize::Catalyst');
install('Test::Pod');
install('Test::Pod::Coverage');

7 thoughts on “Catalyst on Windows with Strawberry Perl

  1. Great! Worked like a charm. I am sucker for automated serialized installations like this. Makes my heart warm seeing all those lines get executed and knowing something is being installed.

    Simply amazing.

    Thanks.

  2. Thanks a ton! These were the only set of instructions that worked like a charm

  3. Sorry but I’ve been running and re-running this script almost all day, about only half of the packages from CPAN have installed successfully. I am running on Strawberry Perl 5.12.3 on Windows 7 x64.

    I’ve never encountered a framework that takes so long to install so unsuccessfully. I really want to give it a try, too. But I’m close to giving up. There are just too many bizarre dependencies and the CPAN installation process, while trying to seem all wise and knowing and fault tolerant, does not really make it clear why things are failing.

    I did get Catalyst to install in some simple configuration on my Linux machine but again… it was like watching the Matrix for three hours before I had a working installation of catalyst.pl even on those systems.

    If Perl and frameworks like Catalyst are to compete with other script languages and Web 2.0 frameworks, they really need to be simple, quick and easy to install. Perl is OK in this regard; but Catalyst just seems impossible to get working on Windows anyway. This is nuts.

  4. I finally got everything installed just now, except for Catalyst::Plugin::Dumper which apparently no longer exists, after figuring out which pre-requisites needed to be “forced” to install after, say, 1 random test failure (e.g., Proc::Background).

    But it was almost an all-day effort watching CPAN gasp and churn, and the test failures make one wonder whether the thing will be stable.

  5. Bob,

    Sorry to hear about your difficulties with the installation. I haven’t used Catalyst in a while, but I definitely agree that the installation takes much longer and more effort than necessary. Part of the problem is the sheer number of dependencies; each of them is constantly being updated and inevitably some component will fail tests on some platforms (relevant or not the failure may be). I remember having to force install several packages too. Packaging & ease of installation is definitely something that Catalyst developers should improve.

    I’ve found other frameworks such as Ruby on Rails and Django to be generally a bit better in this regard, but they haven’t been trouble-free, either. Particularly, mixing operating system packages and manually installed packages inevitably produces an updating mess.

    Anyway, good to hear that you’ve gotten it working successfully now. Thanks for your comments!

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>