Moose在尝试使用Dist::Zilla构建发行版时抛出错误



我在构建Dist::Zilla发行版时遇到了一点麻烦。每次我尝试构建它,或真正做任何事情(即,测试,烟雾,listdeps,无论它是什么),我得到这个错误消息:

Attribute name must be provided before calling reader at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/MooseX/LazyRequire/Meta/Attribute/Trait/LazyRequire.pm line 40
    MooseX::LazyRequire::Meta::Attribute::Trait::LazyRequire::__ANON__('Dist::Zilla::Dist::Builder=HASH(0x53d06e0)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/x86_64-linux/Class/MOP/Mixin/AttributeCore.pm line 45
    Class::MOP::Mixin::AttributeCore::default('Moose::Meta::Class::__ANON__::SERIAL::5=HASH(0x50c9c30)', 'Dist::Zilla::Dist::Builder=HASH(0x53d06e0)') called at reader Dist::Zilla::name (defined at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/Dist/Zilla.pm line 41) line 6
    Dist::Zilla::name('Dist::Zilla::Dist::Builder=HASH(0x53d06e0)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/Dist/Zilla/Dist/Builder.pm line 264
    Dist::Zilla::Dist::Builder::build_in('Dist::Zilla::Dist::Builder=HASH(0x53d06e0)', undef) called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/Dist/Zilla/Dist/Builder.pm line 315
    Dist::Zilla::Dist::Builder::ensure_built_in('Dist::Zilla::Dist::Builder=HASH(0x53d06e0)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/Dist/Zilla/Dist/Builder.pm line 304
    Dist::Zilla::Dist::Builder::ensure_built('Dist::Zilla::Dist::Builder=HASH(0x53d06e0)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/Dist/Zilla/Dist/Builder.pm line 322
    Dist::Zilla::Dist::Builder::build_archive('Dist::Zilla::Dist::Builder=HASH(0x53d06e0)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/Dist/Zilla/App/Command/build.pm line 30
    Dist::Zilla::App::Command::build::execute('Dist::Zilla::App::Command::build=HASH(0x4aeb7b0)', 'Getopt::Long::Descriptive::Opts::__OPT__::2=HASH(0x4bdb150)', 'ARRAY(0x3873fc8)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/App/Cmd.pm line 231
    App::Cmd::execute_command('Dist::Zilla::App=HASH(0x3c6f418)', 'Dist::Zilla::App::Command::build=HASH(0x4aeb7b0)', 'Getopt::Long::Descriptive::Opts::__OPT__::2=HASH(0x4bdb150)') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/App/Cmd.pm line 170
    App::Cmd::run('Dist::Zilla::App') called at /home/mxe/perl5/perlbrew/perls/perl-5.14.0/bin/dzil line 15

之类的。我的dist.ini的内容如下:

author  = Gary Warman <email@host.com>
license = None ; this is an all rights reserved license
copyright_holder = Gary Warman
copyright_year   = 2011
[ReadmeFromPod]
[@Filter]
     -bundle = @Basic
     -remove = Readme
[AutoPrereqs]
[OurPkgVersion] ; use this instead of [PkgVersion]
[PodWeaver]
[MetaNoIndex]
    file = perlcritic.rc
[MetaJSON]
[NextRelease]
        format = %-9v %{yyyy-MM-dd}d ; make Changes Spec happy
[@TestingMania]
     disable = NoTabsTests ; TestSynopsis optional if synopsis is not perl or if it's a     largely generated codebase
     critic_config = perlcritic.rc
[ExtraTests]
[PodSpellingTests]
     wordlist = Pod::Wordlist::hanekomu ;optional
     spell_cmd = aspell list
[PruneFiles]
      filenames = dist.ini
      filenames = weaver.ini
[@Git]
[Git::NextVersion]
     first_version = 0.1.0 ; use semantic versioning if you don't know what this means     read: http://semver.org/ may switch to the semantic versioning plugin at some point.
[CheckChangesHasContent]
[Clean] ; optional, this cleans up directories upon running dzil release.

那么,这里有人知道发生了什么,所以我可以解决这个问题吗?

您的dist.ini文件必须包含name的赋值,这就是那个可怕的错误报告的内容。在文件的最上面插入:

name = My-Awesome-Dist

…它会成功的

相关内容

最新更新