当我启动 Catalyst 时,为什么会收到许多 Moose 警告?

发布于 2024-09-26 09:23:14 字数 5517 浏览 7 评论 0原文

我显然遇到了 Moose/Class::MOP 的问题(与催化剂相关)。启动我的服务器,我得到以下输出...(如下所示)

角色应用程序的别名和排除选项已在 /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application.pm 第 26 行重命名为 -alias 和 -excludes Moose::Meta::Role::Application::new('Moose::Meta::Role::Application::ToRole', 'excludes', 'ARRAY(0x9645568)') 在 /usr/local/lib/ 调用perl/5.10.1/Moose/Meta/Role.pm 第 416 行 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0x95b3368)', 'Moose::Meta::Role=HASH(0x9446d90)', '排除', 'ARRAY(0x9645568) ') 在 /usr/local/lib/perl/5.10.1/Moose/Util.pm 第 133 行调用 Moose::Util::_apply_all_roles('Moose::Meta::Role=HASH(0x9446d90)', undef, 'MooseX::Getopt', 'HASH(0x9454a08)') 在 /usr/local/lib/perl/ 调用5.10.1/Moose/Util.pm 第 87 行 Moose::Util::apply_all_roles('Moose::Meta::Role=HASH(0x9446d90)', 'MooseX::Getopt', 'HASH(0x9454a08)') 在 /usr/local/lib/perl/5.10 调用。 1/Moose/Role.pm 第 26 行 Moose::Role::with('Moose::Meta::Role=HASH(0x9446d90)', 'MooseX::Getopt', 'HASH(0x9454a08)') 在 /usr/local/lib/perl/5.10 调用。 1/Moose/Exporter.pm 第 294 行 Moose::Role::with('MooseX::Getopt', 'HASH(0x9454a08)') 在 /usr/share/perl5/Catalyst/ScriptRole.pm 第 8 行调用 需要在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 第 113 行调用 Catalyst/ScriptRole.pm Class::MOP::__ANON__() 在 /usr/share/perl5/Try/Tiny.pm 第 71 行调用 eval {...} 在 /usr/share/perl5/Try/Tiny.pm 第 67 行调用 Try::Tiny::try('CODE(0x93c2910)', 'Try::Tiny::Catch=REF(0x93bba38)') 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 调用124号线 Class::MOP::load_first_existing_class('Catalyst::ScriptRole') 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 第 136 行调用 Class::MOP::load_class('Catalyst::ScriptRole', undef) 在 /usr/local/lib/perl/5.10.1/Moose/Util.pm 第 109 行调用 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0x8fc9378)', undef, 'Catalyst::ScriptRole') 在 /usr/local/lib/perl/5.10.1/Moose/Util 调用.pm 第 87 行 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x8fc9378)', 'Catalyst::ScriptRole') 在 /usr/local/lib/perl/5.10.1/Moose.pm 第 58 行调用 Moose::with('Moose::Meta::Class=HASH(0x8fc9378)', 'Catalyst::ScriptRole') 在 /usr/local/lib/perl/5.10.1/Moose/Exporter.pm 第 294 行调用 Moose::with('Catalyst::ScriptRole') 在 /usr/share/perl5/Catalyst/Script/Server.pm 第 14 行调用 需要在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 第 113 行调用 Catalyst/Script/Server.pm Class::MOP::__ANON__() 在 /usr/share/perl5/Try/Tiny.pm 第 71 行调用 eval {...} 在 /usr/share/perl5/Try/Tiny.pm 第 67 行调用 Try::Tiny::try('CODE(0x8f6dc38)', 'Try::Tiny::Catch=REF(0x8f8d1c8)') 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 调用124号线 Class::MOP::load_first_existing_class('Catalyst::Script::Server') 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 第 136 行调用 Class::MOP::load_class('Catalyst::Script::Server') 在 /usr/share/perl5/Catalyst/ScriptRunner.pm 第 18 行调用 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Jamaica', 'Server') 在 script/boca_server.pl 第 8 行调用 旧的 Moose::Util::MetaRole API(版本 0.94 之前)已在 /usr/local/lib/perl/5.10.1/Moose/Util/MetaRole.pm 第 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)') 在 /usr/share/perl5/MooseX/MethodAttributes.pm 第 32 行调用 MooseX::MethodAttributes::init_meta('MooseX::MethodAttributes', 'for_class', 'Catalyst::Controller', 'metaclass', undef) 在 /usr/local/lib/perl/5.10.1/Moose/Exporter 调用.pm 第 355 行 Moose::Exporter::__ANON__('MooseX::MethodAttributes') 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 Catalyst::Controller::BEGIN() 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 eval {...} 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 需要在 /usr/share/perl5/Catalyst.pm 第 16 行调用 Catalyst/Controller.pm Catalyst::BEGIN() 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 eval {...} 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 需要在 /home/bobek/dev/build_7.2/mvc/Jamaica/script/../lib/Jamaica.pm 第 17 行调用 Catalyst.pm Jamaica::BEGIN() 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 eval {...} 在 /usr/share/perl5/Catalyst/Controller.pm 第 10 行调用 require Jamaica.pm 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 第 113 行调用 Class::MOP::__ANON__() 在 /usr/share/perl5/Try/Tiny.pm 第 71 行调用 eval {...} 在 /usr/share/perl5/Try/Tiny.pm 第 67 行调用 Try::Tiny::try('CODE(0x8fb3230)', 'Try::Tiny::Catch=REF(0x969fee0)') 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 调用124号线 Class::MOP::load_first_existing_class('Jamaica') 在 /usr/local/lib/perl/5.10.1/Class/MOP.pm 第 136 行调用 Class::MOP::load_class('Jamaica') 在 /usr/share/perl5/Catalyst/ScriptRole.pm 第 61 行调用 Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0x969d748)') 在 /usr/share/perl5/Catalyst/Script/Server.pm 第 181 行调用 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0x969d748)') 在 /usr/local/lib/perl/5.10.1/Class/MOP/Method/Wrapped.pm 调用48号线 Class::MOP::Method::Wrapped::__ANON__('Catalyst::Script::Server=HASH(0x969d748)') 在 /usr/local/lib/perl/5.10.1/Class/MOP/Method/ 调用Wrapped.pm 第 89 行 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0x969d748)') 在 /usr/share/perl5/Catalyst/ScriptRunner.pm 第 20 行调用 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Jamaica', 'Server') 在 script/boca_server.pl 第 8 行调用

我是 Catalyst 的新手(我确实喜欢它,我只是想成功启动并运行它)。我已经检查了 Moose 和 Class::MOP 的最新版本,它们是最新的(就 CPAN 而言)。

希望熟悉 Moose 的人以前见过这个。任何建议或开始检查的地方将不胜感激。

米歇尔·B.

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::MethodAttributes::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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水溶 2024-10-03 09:23:14

您正在运行旧版本的 Catalyst。此问题已在提交 r13516 中得到修复,并且已在 CPAN 上提供版本 5.80026(5.80028 是最新且推荐的)。

Catalyst 正在使用 Moose 的一些已弃用的功能,该功能最近才开始发出警告。

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.

澜川若宁 2024-10-03 09:23:14

所以,你是对的,当前的 Cat 东西有一个相当破碎的依赖链。从 5.80030 的 CPAN 当前通过/失败情况可以看出,失败的次数比正常情况要高得多。

根据当前模块/版本的状态,会有一些变化。今天早上这对我有用(我不确定它是否矫枉过正)-

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

如果您使用 Config::General 进行配置,这也是一个好主意:

cpanm -v Config::General

如果您将它们放入并且它不会启动,只需读取堆栈跟踪(向后)查找名称或丢失的函数/方法。任何您认为有问题的地方,请升级。这是一个“稳定”的套件,但它是移动目标的集合,所有东西都必须对齐。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文