[SP-pm] Erro de versão de módulo ao fazer o tutorial do Catalyst

Otavio Pereira otavio.pereira at gmail.com
Tue Sep 14 14:46:08 PDT 2010


Da documentação do módulo:


> The version of a Perl package on your machine is not always the version you
> need. Obviously, the best thing to do would be to update to the version you
> need. However, you might be in a situation where you're prevented from doing
> this. Perhaps you don't have system administrator privileges; or perhaps you
> are using a package management system such as Debian, and nobody has yet
> gotten around to packaging up the version you need.


> local::lib solves this problem by allowing you to create your own directory
> of Perl packages downloaded from CPAN (in a multi-user system, this would
> typically be within your own home directory). The existing system Perl
> installation is not affected; you simply invoke Perl with special options so
> that Perl uses the packages in your own local package directory rather than
> the system packages. local::lib arranges things so that your locally
> installed version of the Perl packages takes precedence over the system
> installation.


> If you are using a package management system (such as Debian), you don't
> need to worry about Debian and CPAN stepping on each other's toes. Your
> local version of the packages will be written to an entirely separate
> directory from those installed by Debian.


Otávio


2010/9/14 Marcio Ferreira <marciodesouzaferreira em gmail.com>

> Concluindo, é melhor instalar módulos via local::lib que sudo ?
>
>
> Marcio Ferreira
>
>
>
>
> 2010/9/14 Otavio Pereira <otavio.pereira em gmail.com>
>
>> Uau... parece que recebi as dicas de uma dupla sertaneja!
>>
>> Obrigado Bruno e Breno! :-p (Os caras ajudam e ainda saem com essa! rs)
>>
>> Em resumo local::lib, ok.
>>
>>  @Breno: "o" tutorial é o Catalyst::Manual::Tutorial.
>>
>> Abç,
>> Otávio
>>
>>
>> 2010/9/14 breno <breno em rio.pm.org>
>>
>> 2010/9/14 Otavio Pereira <otavio.pereira em gmail.com>:
>>> > Boa tarde pessoal,
>>>
>>> 'tarde :-)
>>>
>>> > Estou fazendo o tutorial do Catalyst e numa máquina com Ubuntu 9.04 e
>>> até
>>> > hoje com uma instalação do perl e modulos do repositório da Canonical.
>>>
>>> "o" tutorial do Catalyst? oO
>>>
>>> É o Catalyst::Manual::Tutorial?
>>>
>>> > Eu estava com a versão 0.20 do Catalyst::Model::DBIC::Schema e no
>>> tutorial pede
>>> > o 0.4. Em princípio pensei em 20 > 4, e gerei o modelo e ele tinha o
>>> > load_classes ao invés do load_namespaces.
>>> > Então eu (conforme orientação do tutorial) :
>>> > $sudo cpan Catalyst::Model::DBIC::Schema
>>> > yadda yadda
>>> > Instalar o Moose (s/n) S
>>> > yadda yadda
>>>
>>> dica: tive alguns problemas instalando módulos com "sudo". Recomendo
>>> ou fazer em dois passos:
>>>
>>> $ sudo su
>>> # cpan Modulo
>>>
>>> ou usar local::lib (procure dar preferência a esse método em vez do
>>> anterior, especialmente se estiver lidando com módulos instalados pelo
>>> sistema de pacotes da sua distro, como parece ser o caso):
>>>
>>> http://search.cpan.org/perldoc?local::lib~[pt_br]
>>>
>>> >  $ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema
>>> create=static
>>> > dbi:SQLite:myapp.db on_connect_do="PRAGMA foreign_keys = ON"
>>> >  exists "/home/genoa/MyApp/script/../lib/MyApp/Model"
>>> >  exists "/home/genoa/MyApp/script/../t"
>>> > The get_method_map method has been made private. The public version is
>>> > deprecated and will be removed in a future release.
>>> >  at /usr/local/lib/perl/5.10.0/Class/MOP/Deprecated.pm line 83
>>> >
>>> >
>>>  Class::MOP::Package::get_method_map('Moose::Meta::Class=HASH(0x347df38)')
>>> > called at /usr/local/share/perl/5.10.0/namespace/autoclean.pm line 41
>>> >         namespace::autoclean::__ANON__() called at
>>> > /usr/local/share/perl/5.10.0/B/Hooks/EndOfScope.pm line 47
>>> >         B::Hooks::EndOfScope::__ANON__('HASH(0x2390d30)',
>>> > 'ARRAY(0x347dc20)') called at
>>> > /usr/local/share/perl/5.10.0/Catalyst/Helper/Model/DBIC/Schema.pm line
>>> 599
>>> >         eval {...} called at
>>> > /usr/local/share/perl/5.10.0/Catalyst/Helper/Model/DBIC/Schema.pm line
>>> 599
>>> >         require Catalyst/Helper/Model/DBIC/Schema.pm called at (eval
>>> 221)
>>> > line 3
>>> >         eval 'require Catalyst::Helper::Model::DBIC::Schema
>>> > ;' called at /usr/share/perl5/Catalyst/Helper.pm line 159
>>> >
>>>  Catalyst::Helper::mk_component('Catalyst::Helper=HASH(0x3111180)',
>>> > 'MyApp', 'model', 'DB', 'DBIC::Schema', 'MyApp::Schema',
>>> 'create=static',
>>> > 'dbi:SQLite:myapp.db', 'on_connect_do=PRAGMA foreign_keys = ON', ...)
>>> called
>>> > at script/myapp_create.pl line 23
>>> > Dumping manual schema for MyApp::Schema to directory
>>> > /home/genoa/MyApp/script/../lib ...
>>> > Schema dump completed.
>>> >  exists "/home/genoa/MyApp/script/../lib/MyApp/Model/DB.pm"
>>> > created "/home/genoa/MyApp/script/../lib/MyApp/Model/DB.pm.new"
>>> >  exists "/home/genoa/MyApp/script/../t/model_DB.t"
>>> > Tentei entender a mensagem de erro, não consegui e tentei então
>>> > atualizar/instalar os módulos citados no erro via comando cpan. Sem
>>> efeito.
>>> > Então desistalei os módulos instalados via cpan
>>> > (Catalyst::Model::DBIC::Schema e Moose) e consigo novamente rodar o
>>> script
>>> > mas gerando o Schema com o load_classes.
>>>
>>> Não foi uma mensagem de erro, e sim um aviso de que a chamada para o
>>> método "get_method_map" está obsoleta, com um trace do problema. Se
>>> você atualizar o módulo "namespace::autoclean", o warning vai embora.
>>>
>>> []s
>>>
>>> -b
>>> _______________________________________________
>>> SaoPaulo-pm mailing list
>>> SaoPaulo-pm em pm.org
>>> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>>>
>>
>>
>> _______________________________________________
>> SaoPaulo-pm mailing list
>> SaoPaulo-pm em pm.org
>> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>>
>
>
> _______________________________________________
> SaoPaulo-pm mailing list
> SaoPaulo-pm em pm.org
> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>
-------------- Pr?xima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20100914/904aa76b/attachment.html>


More information about the SaoPaulo-pm mailing list