开发者

Why do I get many Moose warnings when I start Catalyst?

开发者 https://www.devze.com 2023-01-18 17:15 出处:网络
I am having an issue (Catalyst related) apparently with Moose/Class::MOP. Starting my server I get the following output... (shown below in all its glory)

I am having an issue (Catalyst related) apparently with Moose/Class::MOP. Starting my server I get the following output... (shown below in all its glory)

The alias and excludes options for role application have been renamed -alias and -excludes at /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application.pm line 26 Moose::Meta::Role::Application::new('Moose::Meta::Role::Application::ToRole', 'excludes', 'ARRAY(0x9645568)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Role.pm line 416 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0x95b3368)', 'Moose::Meta::Role=HASH(0x9446d90)', 'excludes', 'ARRAY(0x9645568)') called at /usr/local/lib/perl/5.10.1/Moose/Util.pm line 133 Moose::Util::_apply_all_roles('Moose::Meta::Role=HASH(0x9446d90)', undef, 'MooseX::Getopt', 'HASH(0x9454a08)') called at /usr/local/lib/perl/5.10.1/Moose/Util.pm line 87 Moose::Util::apply_all_roles('Moose::Meta::Role=HASH(0x9446d90)', 'MooseX::Getopt', 'HASH(0x9454a08)') called at /usr/local/lib/perl/5.10.1/Moose/Role.pm line 26 Moose::Role::with('Moose::Meta::Role=HASH(0x9446d90)', 'MooseX::Getopt', 'HASH(0x9454a08)') called at /usr/local/lib/perl/5.10.1/Moose/Exporter.pm line 294 Moose::Role::with('MooseX::Getopt', 'HASH(0x9454a08)') called at /usr/share/perl5/Catalyst/ScriptRole.pm line 8 require Catalyst/ScriptRole.pm called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 113 Class::MOP::__ANON__() called at /usr/share/perl5/Try/Tiny.pm line 71 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x93c2910)', 'Try::Tiny::Catch=REF(0x93bba38)') called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 124 Class::MOP::load_first_existing_class('Catalyst::ScriptRole') called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 136 Class::MOP::load_class('Catalyst::ScriptRole', undef) called at /usr/local/lib/perl/5.10.1/Moose/Util.pm line 109 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0x8fc9378)', undef, 'Catalyst::ScriptRole') called at /usr/local/lib/perl/5.10.1/Moose/Util.pm line 87 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x8fc9378)', 'Catalyst::ScriptRole') called at /usr/local/lib/perl/5.10.1/Moose.pm line 58 Moose::with('Moose::Meta::Class=HASH(0x8fc9378)', 'Catalyst::ScriptRole') called at /usr/local/lib/perl/5.10.1/Moose/Exporter.pm line 294 Moose::with('Catalyst::ScriptRole') called at /usr/share/perl5/Catalyst/Script/Server.pm line 14 require Catalyst/Script/Server.pm called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 113 Class::MOP::__ANON__() called at /usr/share/perl5/Try/Tiny.pm line 71 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x8f6dc38)', 'Try::Tiny::Catch=REF(0x8f8d1c8)') called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 124 Class::MOP::load_first_existing_class('Catalyst::Script::Server') called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 136 Class::MOP::load_class('Catalyst::Script::Server') called at /usr/share/perl5/Catalyst/ScriptRunner.pm line 18 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Jamaica', 'Server') called at script/boca_server.pl line 8 The old Moose::Util::MetaRole API (before version 0.94) has been deprecated at /usr/local/lib/perl/5.10.1/Moose/Util/MetaRole.pm line 16 Moose::Util::MetaRole::apply_metaclass_roles('for_class', 'Catalyst::Controller', 'metaclass_roles', 'ARRAY(0x97bdff8)', 'method_metaclass_roles', 'ARRAY(0x97ab9f0)', 'wrapped_method_metaclass_roles', 'ARRAY(0x981d650)') called at /usr/share/perl5/MooseX/MethodAttributes.pm line 32 MooseX::MethodAttribute开发者_如何学Cs::init_meta('MooseX::MethodAttributes', 'for_class', 'Catalyst::Controller', 'metaclass', undef) called at /usr/local/lib/perl/5.10.1/Moose/Exporter.pm line 355 Moose::Exporter::__ANON__('MooseX::MethodAttributes') called at /usr/share/perl5/Catalyst/Controller.pm line 10 Catalyst::Controller::BEGIN() called at /usr/share/perl5/Catalyst/Controller.pm line 10 eval {...} called at /usr/share/perl5/Catalyst/Controller.pm line 10 require Catalyst/Controller.pm called at /usr/share/perl5/Catalyst.pm line 16 Catalyst::BEGIN() called at /usr/share/perl5/Catalyst/Controller.pm line 10 eval {...} called at /usr/share/perl5/Catalyst/Controller.pm line 10 require Catalyst.pm called at /home/bobek/dev/build_7.2/mvc/Jamaica/script/../lib/Jamaica.pm line 17 Jamaica::BEGIN() called at /usr/share/perl5/Catalyst/Controller.pm line 10 eval {...} called at /usr/share/perl5/Catalyst/Controller.pm line 10 require Jamaica.pm called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 113 Class::MOP::__ANON__() called at /usr/share/perl5/Try/Tiny.pm line 71 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x8fb3230)', 'Try::Tiny::Catch=REF(0x969fee0)') called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 124 Class::MOP::load_first_existing_class('Jamaica') called at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 136 Class::MOP::load_class('Jamaica') called at /usr/share/perl5/Catalyst/ScriptRole.pm line 61 Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0x969d748)') called at /usr/share/perl5/Catalyst/Script/Server.pm line 181 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0x969d748)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Method/Wrapped.pm line 48 Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=HASH(0x969d748)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Method/Wrapped.pm line 89 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0x969d748)') called at /usr/share/perl5/Catalyst/ScriptRunner.pm line 20 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Jamaica', 'Server') called at script/boca_server.pl line 8

I am new at Catalyst (and I do like it, I just want to successfully get it up and running). I have checked the latest versions of Moose and Class::MOP and they are up to date (as far as CPAN is concerned).

Hopefully someone familiar with Moose has seen this before. Any suggestions or a place to start checking would be appreciated.

Michelle B.


You're running an old version of Catalyst. This issue has been fixed in commit r13516 and is already available on CPAN as of version 5.80026 (5.80028 is latest and recommended).

Catalyst was using some deprecated feature of Moose, which just recently started warning.


So, you're right, the current Cat stuff has a fairly broken dependency chain. You can see from the current pass/fail on the CPAN for 5.80030 that fails are much higher than normal.

There are several bumps depending on the state of your current modules/versions. This worked for me this morning (I'm not sure if it's overkill)-

cpanm -v namespace::clean
cpanm -v namespace::autoclean
cpanm -v B::Hooks::EndOfScope
cpanm -v Package::Stash
cpanm -v Class::MOP Moose MooseX::Types
cpanm -v MooseX::Role::WithOverloading::Meta::Role::Application

cpanm -v Catalyst Catalyst::Devel

And if you're using Config::General for your configuration, this is a good idea too:

cpanm -v Config::General

If you get those in and it won't start, just read the stack trace (backwards) looking for names or missing functions/methods. Anything you see as a problem, upgrade. It's a "stable" kit but it's a collection of moving targets and everything has to line up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号