
scott at simpzoid
Mar 16, 2012, 6:57 AM
Views: 254
Permalink
|
|
Newbie DB Schema/Moose Problem
|
|
Hi, I am trying to develop my own application based on the tutorial (Catalyst::Manual::Tutorial::03_MoreCatalystBasics). I have created a mysql database and run: script/easyac_create.pl model DB DBIC::Schema EasyAC::Schema create=static dbi:mysql:ae:localhost user password from which I get the following in, EasyAC\lib\EasyAC\Schema\Result\TSite.pm use utf8; package easyac::schema::result::tsite; # created by dbix::class::schema::loader # do not modify the first part of this file =head1 name easyac::schema::result::tsite =cut use strict; use warnings; use moose; use moosex::nonmoose; use moosex::markasmethods autoclean => 1; extends 'dbix::class::core'; =head1 components loaded =over 4 =item * l<dbix::class::inflatecolumn::datetime> =back =cut __package__->load_components("inflatecolumn::datetime"); =head1 table: c<t_sites> =cut __package__->table("t_sites"); =head1 accessors =head2 f_id data_type: 'integer' is_auto_increment: 1 is_nullable: 0 =head2 f_site_name data_type: 'varchar' is_nullable: 1 size: 30 =head2 f_start_date data_type: 'date' datetime_undef_if_invalid: 1 is_nullable: 1 =head2 f_mileage data_type: 'smallint' is_nullable: 1 =head2 f_main_employer data_type: 'tinyint' is_nullable: 1 =cut __package__->add_columns( "f_id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "f_site_name", { data_type => "varchar", is_nullable => 1, size => 30 }, "f_start_date", { data_type => "date", "datetime_undef_if_invalid" => 1, is_nullable => 1 }, "f_mileage", { data_type => "smallint", is_nullable => 1 }, "f_main_employer", { data_type => "tinyint", is_nullable => 1 }, ); =head1 primary key =over 4 =item * l</f_id> =back =cut __package__->set_primary_key("f_id"); # created by dbix::class::schema::loader v0.07017 @ 2012-03-16 12:24:06 # do not modify this or anything above! md5sum:thrgux1gf1pldhocjy15fq # you can replace this text with custom code or comments, and it will be preserved on regeneration __package__->meta->make_immutable; 1; When I try to start the development server I get: Due to a method name conflict in roles 'CatalystX::Component::Traits' and 'MooseX::Traits::Pluggable', the method '_find_trait' must be implemented or excluded by 'Catalyst::Model::DBIC::Schema' at /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application/ToClass.pm line 134 Moose::Meta::Role::Application::ToClass::check_required_methods('Moose::Meta::Role::Application::ToClass=HASH(0xa733388)', 'Moose::Meta::Role=HASH(0xa730830)', 'Moose::Meta::Class=HASH(0xa689110)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application.pm line 55 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa733388)', 'Moose::Meta::Role=HASH(0xa730830)', 'Moose::Meta::Class=HASH(0xa689110)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application/ToClass.pm line 36 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa733388)', 'Moose::Meta::Role=HASH(0xa730830)', 'Moose::Meta::Class=HASH(0xa689110)', 'HASH(0xa7577f8)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Role.pm line 470 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa730830)', 'Moose::Meta::Class=HASH(0xa689110)') called at /usr/local/lib/perl/5.10.1/Moose/Util.pm line 160 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa689110)', undef, 'CatalystX::Component::Traits') called at /usr/local/lib/perl/5.10.1/Moose/Util.pm line 99 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa689110)', 'CatalystX::Component::Traits') called at /usr/local/lib/perl/5.10.1/Moose.pm line 67 Moose::with('Moose::Meta::Class=HASH(0xa689110)', 'CatalystX::Component::Traits') called at /usr/local/lib/perl/5.10.1/Moose/Exporter.pm line 370 Moose::with('CatalystX::Component::Traits') called at /usr/local/share/perl/5.10.1/Catalyst/Model/DBIC/Schema.pm line 6 require Catalyst/Model/DBIC/Schema.pm called at (eval 664) line 3 eval 'require Catalyst::Model::DBIC::Schema ;' called at /usr/share/perl/5.10/base.pm line 90 base::import('base', 'Catalyst::Model::DBIC::Schema') called at /home/scott/Catalyst/EasyAC/lib/EasyAC/Model/DB.pm line 4 EasyAC::Model::DB::BEGIN() called at /usr/local/share/perl/5.10.1/Catalyst/Model/DBIC/Schema.pm line 0 eval {...} called at /usr/local/share/perl/5.10.1/Catalyst/Model/DBIC/Schema.pm line 0 require EasyAC/Model/DB.pm called at /usr/local/share/perl/5.10.1/Catalyst/Utils.pm line 317 eval {...} called at /usr/local/share/perl/5.10.1/Catalyst/Utils.pm line 317 Catalyst::Utils::ensure_class_loaded('EasyAC::Model::DB', 'HASH(0xa61eb10)') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 2504 Catalyst::setup_components('EasyAC') called at /usr/local/share/perl/5.10.1/Catalyst.pm line 1162 Catalyst::setup('EasyAC') called at /home/scott/Catalyst/EasyAC/lib/EasyAC.pm line 57 require EasyAC.pm called at /usr/local/share/perl/5.10.1/Module/Runtime.pm line 317 Module::Runtime::require_module('EasyAC') called at /usr/local/share/perl/5.10.1/Class/Load.pm line 177 Class::Load::__ANON__() called at /usr/local/share/perl/5.10.1/Try/Tiny.pm line 71 eval {...} called at /usr/local/share/perl/5.10.1/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x9eb2ad8)', 'Try::Tiny::Catch=REF(0x9a24648)') called at /usr/local/share/perl/5.10.1/Class/Load.pm line 183 Class::Load::try_load_class('EasyAC', undef) called at /usr/local/share/perl/5.10.1/Class/Load.pm line 38 Class::Load::load_class('EasyAC') called at /usr/local/share/perl/5.10.1/Catalyst/ScriptRole.pm line 83 Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0x9eb2be8)') called at /usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm line 239 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0x9eb2be8)') called at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'EasyAC', 'Server') called at script/easyac_server.pl line 8 Compilation failed in require at (eval 664) line 3. ...propagated at /usr/share/perl/5.10/base.pm line 93. BEGIN failed--compilation aborted at /home/scott/Catalyst/EasyAC/lib/EasyAC/Model/DB.pm line 4. Compilation failed in require at /usr/local/share/perl/5.10.1/Catalyst/Utils.pm line 317. Compilation failed in require at /usr/local/share/perl/5.10.1/Module/Runtime.pm line 317. at /usr/local/share/perl/5.10.1/Catalyst/Script/Server.pm line 239 Can someone tell me how to fix this?
|