Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Newbie DB Schema/Moose Problem

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


scott at simpzoid

Mar 16, 2012, 6:57 AM

Post #1 of 4 (371 views)
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?


jjn1056 at yahoo

Mar 16, 2012, 7:22 AM

Post #2 of 4 (370 views)
Permalink
Re: Newbie DB Schema/Moose Problem [In reply to]

Scott,

I recall seeing this error before, and my gut feeling is you don't have compatible versions of the metioned libs. A bit of google search gets me:

http://lists.scsys.co.uk/pipermail/catalyst/2011-December/028039.html


Which suggests some approaches.

However one thing I really recommend is to avoid using your 'system perl' (installed globally under /usr/bin). This is really going to put you in a world of confusion. The community best and supported practice for development is to install a local perl using perlbrew and keep you dependency chain clean.

Here's some docs:http://learn.perl.org/installing/

I realize it may feel like an un-needed step to install a user level Perl for development, but believe me when I say it will make your life easier. Following this method I very seldomly have trouble installing stuff from cpan.

John



>________________________________
> From: Scott Simpson2 <scott [at] simpzoid>
>To: catalyst [at] lists
>Sent: Friday, March 16, 2012 9:57 AM
>Subject: [Catalyst] 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?
>_______________________________________________
>List: Catalyst [at] lists
>Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
>Dev site: http://dev.catalyst.perl.org/
>
>
>


jjn1056 at yahoo

Mar 16, 2012, 7:22 AM

Post #3 of 4 (368 views)
Permalink
Re: Newbie DB Schema/Moose Problem [In reply to]

Scott,

I recall seeing this error before, and my gut feeling is you don't have compatible versions of the metioned libs. A bit of google search gets me:

http://lists.scsys.co.uk/pipermail/catalyst/2011-December/028039.html


Which suggests some approaches.

However one thing I really recommend is to avoid using your 'system perl' (installed globally under /usr/bin). This is really going to put you in a world of confusion. The community best and supported practice for development is to install a local perl using perlbrew and keep you dependency chain clean.

Here's some docs:http://learn.perl.org/installing/

I realize it may feel like an un-needed step to install a user level Perl for development, but believe me when I say it will make your life easier. Following this method I very seldomly have trouble installing stuff from cpan.

John



>________________________________
> From: Scott Simpson2 <scott [at] simpzoid>
>To: catalyst [at] lists
>Sent: Friday, March 16, 2012 9:57 AM
>Subject: [Catalyst] 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?
>_______________________________________________
>List: Catalyst [at] lists
>Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
>Dev site: http://dev.catalyst.perl.org/
>
>
>


scott at simpzoid

Mar 16, 2012, 8:40 AM

Post #4 of 4 (373 views)
Permalink
Re: Newbie DB Schema/Moose Problem [In reply to]

John,
 
Thanks very much for the prompt reply and pointers to further help.  Your reply
has reminded me that I had to force install Moose and having a local version
seems like an idea worth investigating.
 
Thanks again.
 
Scott

 


On March 16, 2012 at 3:22 PM John Napiorkowski <jjn1056 [at] yahoo> wrote:

> Scott,
>
> I recall seeing this error before, and my gut feeling is you don't have
> compatible versions of the metioned libs.  A bit of google search gets me:
>
> http://lists.scsys.co.uk/pipermail/catalyst/2011-December/028039.html
>
>
> Which suggests some approaches.
>
> However one thing I really recommend is to avoid using your 'system perl'
> (installed globally under /usr/bin).  This is really going to put you in a
> world of confusion.  The community best and supported practice for development
> is to install a local perl using perlbrew and keep you dependency chain clean.
>
> Here's some docs: http://learn.perl.org/installing/
>
> I realize it may feel like an un-needed step to install a user level Perl for
> development, but believe me when I say it will make your life easier.
>  Following this method I very seldomly have trouble installing stuff from
> cpan.
>
> John
>
>
>
> >________________________________
> > From: Scott Simpson2 <scott [at] simpzoid>
> >To: catalyst [at] lists
> >Sent: Friday, March 16, 2012 9:57 AM
> >Subject: [Catalyst] 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?
> >_______________________________________________
> >List: Catalyst [at] lists
> >Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> >Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
> >Dev site: http://dev.catalyst.perl.org/
> >
> >
> >

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.