tempire / MojoExample

Mojolicious example with DBIx::Class schema load, deploy, fixtures, and tests.
mojoexample.herokuapp.com
138 stars 28 forks source link

Problems running the scripts #12

Open phase-t opened 9 years ago

phase-t commented 9 years ago

Hey so the main application runs just fine for me, and I'm on ubuntu 14.04 LTS 32 bit.. Running the morbo development server with the mojolite app works just fine.

However, for some reason I am getting errors when I try to run the files that are in the t/ and script/ directories... especially those controller tests, I can't even run t/blogs.t without this error in particular:

~/mojo/MojoExample$ perl t/blogs.t Can't locate Schema.pm in @INC (you may need to install the Schema module) (@INC contains: ../lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at t/blogs.t line 5. BEGIN failed--compilation aborted at t/blogs.t line 5.

Now most advice I find points me to proper usage of @INC and the use/require statements, so I tried adding "use lib '../lib';" to that file t/blogs.t so that @INC will look in that folder but it makes no difference.

2 months ago, I had it all working, though I recall solving similar issues in the process. When I run the script/generate_schema file, my shell complains about this similar issue with the @INC array:

~/mojo/MojoExample$ perl script/generate_schema Can't locate DBIx/Class/Schema/Loader.pm in @INC (you may need to install the DBIx::Class::Schema::Loader module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at script/generate_schema line 4.

This problem persists, after having already installed the DBIx::Class::Schema::Loader from CPAN.

Do I have a dependency issue going horribly wrong? I'm banging my head against my desk, hoping that this is just some type of noobie problem with a quick fix... 2 months ago, I was able to run the controller tests and populate the test.db with my modifications to the fixtures. Now all of sudden the @INC array is just whipping me back lol. I just reinstalled ubuntu to clean my kernel up but the same problems are persisting.

Any time and attention to these matters is greatly appreciated. I appologize if I cause any face-palming, heh..

mohawk2 commented 6 years ago

In case anyone else has this; have you tried:

cpanm --installdeps .
prove -l t