perl - Sqlite unable to find DB file with Mojolicious and Par Packer -


i'm writing program perl uses mojolicious , sqlite. using par packer distribute .exe file deployment on other windows machines.

i use strawberry perl on windows development.

i use following windows batch file par packer generate .exe file:

pp -o hallo.exe ^     -x ^     -l libeay32__.dll ^     -l zlib1__.dll ^     -l ssleay32__.dll ^     -a lib ^     -a public ^     -a templates ^     -a "c:\strawberry\perl\site\lib\mojo\entities.txt;mojo\entities.txt" ^     -a "c:\strawberry\perl\vendor\lib\mojolicious\resources\public;mojolicious\public" ^     -a "c:\strawberry\perl\vendor\lib\mojolicious\resources\templates;mojolicious\templates" ^     -a "d:\perl\main.db" ^     hallo.cgi 

this above works bring in sqlite got following error when trying run hello.exe : dbd::sqlite::db prepare failed: no such table: libraries

hallo.cgi works fine when run normally. perl hallo.cgi example. when compiled .exe file sqlite error occurs.

what happens here main.db (an sql lite database file) in same location hallo.cgi (or hallo.exe) when run hallo.exe sqlite cannot find main.db , creates main.db on it's own because created on it's own there no data in database cannot find libraries table.

how go solve problem?

in batch file above use compiling include main.db par packer seem ignores line:

-a "d:\perl\main.db" ^ 

update: seem have solved looking @ $env{pwd} is. ($env{pwd} indicates working directory) , using chdir change it. once in sqlite able file , work properly. note in source code have operations includes libraries , modules par packer needs created situation working directory changed. changing original working directory solved this.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -