FAQ
Hello,

I have read the POD documentation of the myapp_create.pl and I have seen:

myapp_create.pl model SomeDB DBIC::SchemaLoader dbi:SQLite:/tmp/my.db

I have tried running that kind of command, but I have received the following
error:

Couldn't load helper "Catalyst::Helper::Model::DBIC::SchemaLoader", "Can't
locate Catalyst/Helper/Model/DBIC/SchemaLoader.pm in @INC (@INC contains:
D:/usr/site/lib D:/usr/lib .) at (eval 12) line 3.

I have searched with PPM and cpan for
Catalyst::Helper::Model::DBIC::SchemaLoader

but I couldn't find anything like that. I have also searched for just
"SchemaLoader" on cpan, with no results.

I have seen a module named Schema.pm in that location however. Is there a
mistake in the POD of the _create.pl program and I should use the ::Schema
instead?

Or another module is actually missing and the error given is not ok?

Thank you.

Octavian

Search Discussions

  • Leandro Hermida at Dec 24, 2006 at 12:45 pm

    From: Octavian Rasnita
    Sent: Sunday, December 24, 2006 5:32 AM
    Subject: [Catalyst] SchemaLoader?

    Hello,

    I have read the POD documentation of the myapp_create.pl and
    I have seen:

    myapp_create.pl model SomeDB DBIC::SchemaLoader dbi:SQLite:/tmp/my.db

    I have tried running that kind of command, but I have
    received the following
    error:

    Couldn't load helper
    "Catalyst::Helper::Model::DBIC::SchemaLoader", "Can't locate
    Catalyst/Helper/Model/DBIC/SchemaLoader.pm in @INC (@INC contains:
    D:/usr/site/lib D:/usr/lib .) at (eval 12) line 3.

    I have searched with PPM and cpan for
    Catalyst::Helper::Model::DBIC::SchemaLoader

    but I couldn't find anything like that. I have also searched
    for just "SchemaLoader" on cpan, with no results.

    I have seen a module named Schema.pm in that location
    however. Is there a mistake in the POD of the _create.pl
    program and I should use the ::Schema instead?

    Or another module is actually missing and the error given is not ok?

    Thank you.

    Octavian
    Hi,

    There is no Catalyst::Helper::Model::DBIC::SchemaLoader. Use the
    DBIC::Schema helper with the create option in order to generate a model
    from a DBIx::Class::Schema::Loader setup. See the
    Catalyst::Helper::Model::DBIC::Schema docs for information on this.

    Leandro
  • Octavian Rasnita at Dec 24, 2006 at 3:22 pm
    From: "Hermida, Leandro" <Leandro.Hermida@fmi.ch>
    There is no Catalyst::Helper::Model::DBIC::SchemaLoader. Use the
    DBIC::Schema helper with the create option in order to generate a model
    from a DBIx::Class::Schema::Loader setup. See the
    Catalyst::Helper::Model::DBIC::Schema docs for information on this.

    Leandro
    I thought that my problem could be due to the fact that I was using an older
    version of Catalyst, so I have installed the latest version of Catalyst,
    some modules by using PPM, and some using the CPAN shell.

    Now I have an up-to-date framework, but I still cannot use that helper
    module for creating the schema. I have seen that the helper module is
    installed, but when giving the command:

    perl script/tranzactiibursiere_create.pl model SecondDB DBIC::Schema
    TranzactiiBursiere::S2 create=static dbi:mysql:database=intranet root

    it gives the error:

    Attempt to free unreferenced scalar: SV 0x237e190, Perl interpreter:
    0x274324 at
    D:/usr/site/lib/DBIx/Class/Schema/Loader/Base.pm line 501.
    Can't use an undefined value as an ARRAY reference at
    D:/usr/site/lib/DBIx/Class
    /Schema/Loader/DBI.pm line 96.
    Attempt to free unreferenced scalar: SV 0x2413668, Perl interpreter:
    0x274324.
    -----

    I have tried to reinstall DBIx::Class::Schema::Loader because it might be
    wrong installed, but I couldn't do it because it uses the module
    IO::Tty
    and I couldn't install that module under Windows.

    I have seen that for installing DBIx::Class::Schema::Loader, more other CPAN
    modules were missing. It is strange how that this module is installed
    without having those other modules installed.
    I have also searched this module on ppm, but I couldn't find it.

    I have installed all other modules needed, but I couldn't install IO::Tty,
    so I cannot install it properly from cpan.

    I don't know if those errors given by the Catalyst helper module are because
    IO::Tty is missing or because there might be another problem.

    So unfortunately I cannot use the Catalyst helper module for creating the
    Scheme under Windows.

    Octavian
  • Nilson Santos Figueiredo Junior at Dec 24, 2006 at 5:17 pm

    On 12/24/06, Octavian Rasnita wrote:
    Attempt to free unreferenced scalar: SV 0x237e190, Perl interpreter:
    0x274324 at
    D:/usr/site/lib/DBIx/Class/Schema/Loader/Base.pm line 501.
    These errors are not usually errors per se - just warnings. And
    everything ends up working correctly. Either way, reinstalling a newer
    DBI version should do away with some of those.
    I have tried to reinstall DBIx::Class::Schema::Loader because it might be
    wrong installed, but I couldn't do it because it uses the module
    IO::Tty
    and I couldn't install that module under Windows.
    This is pretty weird because I've the latest
    DBIx::Class::Schema::Loader version (0.03009) installed here on my
    Windows machine and I don't have IO::Tty installed (since that's not
    even possible under Win32). And it's working like charm.

    Are you sure you're correctly installing it (perl -MCPAN -e "install
    DBIx::Class::Schema::Loader") and using a good CPAN mirror?
    So unfortunately I cannot use the Catalyst helper module for creating the
    Scheme under Windows.
    Well, I use it almost on a daily basis and it works pretty well.
    You're probably doing something wrong along the way. Maybe if you send
    us a complete install log as output by CPAN install we could help you
    a bit more.

    -Nilson Santos F. Jr.
  • Octavian Rasnita at Dec 24, 2006 at 8:10 pm
    From: "Nilson Santos Figueiredo Junior" <acid06@gmail.com>
    These errors are not usually errors per se - just warnings. And
    everything ends up working correctly. Either way, reinstalling a newer
    DBI version should do away with some of those.
    Hi,

    I've made a mistake. I thought that if I could use ppm install [module], I
    could also use cpan install [module], without starting the cpan> shell first
    (so in fact I was trying to install the module "install".

    Anyway, if I try to install DBIx::Class::Schema::Loader correctly, it tells
    that it is already installed.
    I have also tried to install DBI from cpan, but I have the latest version.

    After running the helper application:

    perl script/tranzactiibursiere_create.pl model AnotherDB DBIC::Schema
    TranzactiiBursiere::AnotherDB create=static dbi:mysql:database=intranet root

    it still gives that warning, and it doesn't create anything.
    It doesn't create
    lib/TranzactiiBursiere/AnotherDB.pm
    lib/TranzactiiBursiere/AnotherDB/*
    lib/TranzactiiBursiere/Model/AnotherDB.pm

    When I have tried the same command under Linux, it worked well.

    I have also tried to rename that module and to re-install it using cpan. It
    was reinstalled, but when running the Catalyst helper, it gives the same
    error.

    I have also tried running that command in TextPad editor command line, and
    TextPad made that kind of sound it use to make when there is an error and
    not a warning, so I think that it is an error and not a warning.

    I have also reinstalled
    Catalyst::Helper::Model::DBIC
    and
    Catalyst::Helper::Model::DBIC::Schema

    but with no effect.

    Can you tell me what version of perl do you have? I use ActivePerl 5.8.8
    build 819.

    I think I might need to reinstall Catalyst...

    Thanks.

    Octavian
  • Nilson Santos Figueiredo Junior at Dec 25, 2006 at 4:42 am

    On 12/25/06, Octavian Rasnita wrote:
    Can you tell me what version of perl do you have? I use ActivePerl 5.8.8
    build 819.
    Same here.

    Have you tried updating DBI itself (not DBIx::Class), using the CPAN
    shell, as I've said before? That usually does away with those
    unreferenced scalars warnings.

    Note that, in order to properly install DBI you'll need to have a
    properly configured C compiling environment. Under Win32 using AS Perl
    you can achieve that by either having Microsoft Visual C++ installed
    or by having a working gcc (mingw) environment. Since MSVC licenses
    are expensive, I'll assume you don't have one and you'll follow the
    gcc path. The easiest way to get everything working using gcc is to
    install Bloodshed Dev-Cpp with is an open source IDE-wannabe. After
    that you'll just need to set up some environment vars and your CPAN
    shell will automatically recognize what it calls a "gcc environment".

    There's also something called Strawberry Perl, which supposedly makes
    things easier. When I've tried it, I couldn't get things to work at
    all, so I prefer the AS Perl + Dev-Cpp combo. It's a tried and tested
    setup, which I've replicated to many boxes already.

    If you've already got all of this set up, you can ignore it and just
    try updating DBI and, hopefully, your problems will be gone.

    -Nilson Santos F. Jr.
  • Octavian Rasnita at Dec 25, 2006 at 10:17 am
    From: "Nilson Santos Figueiredo Junior" <acid06@gmail.com>
    Have you tried updating DBI itself (not DBIx::Class), using the CPAN
    shell, as I've said before? That usually does away with those
    unreferenced scalars warnings.
    Yes, I also tried that using:

    cpan
    cpan> install DBI

    But it told that the latest DBI is already installed.

    Now I've just tried again using:

    cpan> force install DBI

    It couldn't install DBI well because cpan couldn't delete dbi.dll (because
    Apache was using it), so I have stopped Apache, renamed dbi.dll to something
    else, and tried again.

    After forcing a new DBI install, the Catalyst helper works well, without any
    error and it creates all the files that it should create.

    Thank you all for your help.

    Octavian
  • Nilson Santos Figueiredo Junior at Dec 25, 2006 at 3:06 pm

    On 12/25/06, Octavian Rasnita wrote:
    After forcing a new DBI install, the Catalyst helper works well, without any
    error and it creates all the files that it should create.
    That's probably because you've previously updated DBI using PPM
    instead of the CPAN shell.
    PPM can be a real life saver when you need to install something on a
    Windows box without a C compiler environment. But whenever you can
    avoid it, it's best if you do avoid it.

    Last time I checked PPM didn't even have the latest DBI version,
    that's why I assumed you wouldn't have it either.

    -Nilson Santos F. Jr.
  • Octavian Rasnita at Dec 25, 2006 at 3:21 pm
    Oh no, right before I've installed DBI with the cpan shell by force, I have
    tried installing it with cpan shell, and it told me that I have the latest
    version installed.

    If it were able to install a newer version by just using
    cpan> install DBI
    I wouldn't need to use
    cpan> force install DBI

    But it is not the first time I found that the cpan is not detecting right
    the version of a module.
    Anyway, I'm happy it works.

    But I have another question about using the DBIx::Class, or better said
    about SQL::Translator...

    I have read in the POD docs that an .sql file can be created from a
    DBIx::Class schema, and I have tried doing this in more ways, but without
    success. If you know the syntax of the command line, can you please tell me?

    I have tried:

    sqlt --from DBIx::Class --to MySQL Schema.pm > mysql.sql

    It gives an error telling that there is no subroutine DBIx::Class::Parser.

    Thank you.

    Octavian

    ----- Original Message -----
    From: "Nilson Santos Figueiredo Junior" <acid06@gmail.com>
    To: "The elegant MVC web framework" <catalyst@lists.rawmode.org>
    Sent: Monday, December 25, 2006 7:06 AM
    Subject: Re: [Catalyst] SchemaLoader?

    On 12/25/06, Octavian Rasnita wrote:
    After forcing a new DBI install, the Catalyst helper works well, without
    any
    error and it creates all the files that it should create.
    That's probably because you've previously updated DBI using PPM
    instead of the CPAN shell.
    PPM can be a real life saver when you need to install something on a
    Windows box without a C compiler environment. But whenever you can
    avoid it, it's best if you do avoid it.

    Last time I checked PPM didn't even have the latest DBI version,
    that's why I assumed you wouldn't have it either.

    -Nilson Santos F. Jr.

    _______________________________________________
    List: Catalyst@lists.rawmode.org
    Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.rawmode.org/
    Dev site: http://dev.catalyst.perl.org/
  • Jon Schutz at Dec 25, 2006 at 10:31 pm
    Likewise I couldn't get sqlt to work with DBIx::Class; it doesn't seem
    to be set up to take the DBIx::Class options. But you can achieve the
    same end like this:

    use SQL::Translator;

    my $translator = SQL::Translator->new(
    debug => 0,
    trace => 0,
    parser => 'SQL::Translator::Parser::DBIx::Class',
    parser_args => { 'DBIx::Schema' => 'Your::Schema' },
    to => 'MySQL',
    );
    my $output = $translator->translate();
    print STDERR $translator->error unless $output;
    print $output;

    On Mon, 2006-12-25 at 07:21 -0800, Octavian Rasnita wrote:

    But I have another question about using the DBIx::Class, or better said
    about SQL::Translator...

    I have read in the POD docs that an .sql file can be created from a
    DBIx::Class schema, and I have tried doing this in more ways, but without
    success. If you know the syntax of the command line, can you please tell me?

    I have tried:

    sqlt --from DBIx::Class --to MySQL Schema.pm > mysql.sql

    It gives an error telling that there is no subroutine DBIx::Class::Parser.

    Thank you.

    Octavian
  • Octavian Rasnita at Dec 26, 2006 at 5:37 am
    From: "Jon" <jon+catalyst@youramigo.com>
    Likewise I couldn't get sqlt to work with DBIx::Class; it doesn't seem
    to be set up to take the DBIx::Class options. But you can achieve the
    same end like this:
    Ok, thanks. It works this way. It create an almost perfectly database!

    Octavian
  • Emanuele Zeppieri at Dec 25, 2006 at 9:16 pm

    -----Original Message-----
    From: Nilson Santos Figueiredo Junior
    Sent: Monday, December 25, 2006 4:07 PM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] SchemaLoader?
    [...]
    Last time I checked PPM didn't even have the latest DBI version,
    that's why I assumed you wouldn't have it either.
    Nilson, there are several PPM repositories, and the availability of the
    various CPAN packages depends on the repositories you are querying, of
    course.

    As for DBI, there are at least three different PPM repositories which
    have the latest version (1.53):
    http://ppm.activestate.com/BuildStatus/5.8-D.html
    http://trouchelle.com/perl/ppmrepview.pl
    http://theoryx5.uwinnipeg.ca/ppmpackages/

    A list of many PPM repositories (though not complete), as well as the
    instructions to insert them into the ppm (the program) repositories
    list, is given by the CPAN module PPM::Repositories
    http://search.cpan.org/search?query=PPM%3A%3ARepositories&mode=all

    Cheers,
    Emanuele.
  • Nilson Santos Figueiredo Junior at Dec 26, 2006 at 1:36 am

    On 12/25/06, Emanuele Zeppieri wrote:
    Nilson, there are several PPM repositories, and the availability of the
    various CPAN packages depends on the repositories you are querying, of
    course.
    Yes, I'm aware of that and usually I've got every repository under the
    sun configured on my PPM shell.

    "Last time I checked" means "a long long time ago". If I remember
    correctly, it was when DBI 1.50 had been released but only 1.49 was
    available on PPM.

    -Nilson Santos F. Jr.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 23, '06 at 6:34p
activeDec 26, '06 at 5:37a
posts13
users5
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase