in reply to Help with mojolicious

Schema.pm goes in Moblo according to tutorial not Moblo/Schema. Put this code in MojoDojo/lib/t.pl
use lib '.'; use Moblo::Schema; my $schema = Moblo::Schema->connect('dbi:SQLite:moblo.db'); $schema->deploy();
Then run using 'perl t.pl'. If you get an error message about dependencies, install SQL::Translator. I found that in the DBIx::Class::Optional::Dependencies documentation. search on 'deploy' and it's about halfway down. You end up with a database file moblo.db that looks like this:
sqlite> .schema CREATE TABLE posts ( id INTEGER PRIMARY KEY NOT NULL, author text NOT NULL, title text NOT NULL, content text NOT NULL, date_published datetime NOT NULL );

Replies are listed 'Best First'.
Re^2: Help wiht mojolicious
by Anonymous Monk on Mar 17, 2015 at 06:37 UTC
      Ahh I'm just starting to use GIT, this post seemed perfect excuse to practice. When I cloned I could have sworn it was not in the same directory as the tutorial indicated. I believe you, another git exercise will be showing rev. history I guess. The first error message I saw was "Can't locate in @INC", so I speculated that maybe OP was running it from the wrong directory.
Re^2: Help wiht mojolicious
by Anonymous Monk on Mar 17, 2015 at 07:26 UTC
    Hmm, I tried it all in one file, files are created, but they're mostly empty , no tables no schema gets created ... weird :)

      Guess: the AM author of the immediate parent node (to whom this reply is directed) is actually caseycole589 after logging out.

      If so, caseycole589, the same question as posed by the AM of the initial reply stands: what happened? What error/warning messages/ What output? If any, how did it differ from your intent?


      Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
      1. code
      2. verbatim error and/or warning messages
      3. a coherent explanation of what "doesn't work actually means.

        Sorry about that I would have put errors but there weren't many descriptive things/errors to put. It was more I was just lost on where to go and trying random things after spending a couple of hours reading through perl docs I am still pretty new to perl. Thanks everyone for the help shortly after posting this I figured out the dependency on my own. That was one problem the other was I needed to add

        use lib '.'; use Moblo::Schema;

        In a file file in the right directory that was the other

        Guess: the AM author of the immediate parent node (to whom this reply is directed) is actually caseycole589 after logging out.

        Nope, its me ... I figured since it apparently worked for trippledubs, it was weird it didn't work from a singlefile